-
Notifications
You must be signed in to change notification settings - Fork 2
/
server_actions.go
78 lines (75 loc) · 2.4 KB
/
server_actions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package api
// Copyright 2016, JuanDeFu.ca. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
import (
"net/http"
"sabey.co/spoofgo/movement"
)
func (self *Server) Accelerate(w http.ResponseWriter, r *http.Request) {
movement.Accelerate()
self.APIRespond(nil, w, r, 200)
}
func (self *Server) Decelerate(w http.ResponseWriter, r *http.Request) {
movement.Decelerate()
self.APIRespond(nil, w, r, 200)
}
func (self *Server) Right(w http.ResponseWriter, r *http.Request) {
movement.Right()
self.APIRespond(nil, w, r, 200)
}
func (self *Server) Left(w http.ResponseWriter, r *http.Request) {
movement.Left()
self.APIRespond(nil, w, r, 200)
}
func (self *Server) NorthWest(w http.ResponseWriter, r *http.Request) {
movement.NorthWest()
self.APIRespond(nil, w, r, 200)
}
func (self *Server) NorthEast(w http.ResponseWriter, r *http.Request) {
movement.NorthEast()
self.APIRespond(nil, w, r, 200)
}
func (self *Server) SouthWest(w http.ResponseWriter, r *http.Request) {
movement.SouthWest()
self.APIRespond(nil, w, r, 200)
}
func (self *Server) SouthEast(w http.ResponseWriter, r *http.Request) {
movement.SouthEast()
self.APIRespond(nil, w, r, 200)
}
func (self *Server) Flip(w http.ResponseWriter, r *http.Request) {
movement.Flip()
self.APIRespond(nil, w, r, 200)
}
func (self *Server) ToggleMode(w http.ResponseWriter, r *http.Request) {
movement.ToggleMode()
self.APIRespond(nil, w, r, 200)
}
func (self *Server) Walk(w http.ResponseWriter, r *http.Request) {
movement.SetMode(movement.WALK)
self.APIRespond(nil, w, r, 200)
}
func (self *Server) Jog(w http.ResponseWriter, r *http.Request) {
movement.SetMode(movement.JOG)
self.APIRespond(nil, w, r, 200)
}
func (self *Server) Bicycle(w http.ResponseWriter, r *http.Request) {
movement.SetMode(movement.BICYCLE)
self.APIRespond(nil, w, r, 200)
}
func (self *Server) Car(w http.ResponseWriter, r *http.Request) {
movement.SetMode(movement.CAR)
self.APIRespond(nil, w, r, 200)
}
func (self *Server) ResetModifier(w http.ResponseWriter, r *http.Request) {
movement.ResetModifier()
self.APIRespond(nil, w, r, 200)
}
func (self *Server) IncreaseModifier(w http.ResponseWriter, r *http.Request) {
movement.IncreaseModifier()
self.APIRespond(nil, w, r, 200)
}
func (self *Server) DecreaseModifier(w http.ResponseWriter, r *http.Request) {
movement.DecreaseModifier()
self.APIRespond(nil, w, r, 200)
}