-
Notifications
You must be signed in to change notification settings - Fork 2
/
commands.go
121 lines (99 loc) · 3.73 KB
/
commands.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package rendering
import (
"github.com/allada/gdd/protocol/shared"
)
type SetShowPaintRectsCommand struct {
DestinationTargetID string
responseId int64
conn *shared.Connection
Result bool `json:"result"`// True for showing paint rectangles
}
type SetShowPaintRectsReturn struct {
}
func (c *SetShowPaintRectsCommand) Initalize(targetId string, responseId int64, conn *shared.Connection) {
c.DestinationTargetID = targetId
c.responseId = responseId
c.conn = conn
}
func (c *SetShowPaintRectsCommand) RespondWithError(code shared.ResponseErrorCodes, message string) {
c.conn.SendErrorResult(c.responseId, c.DestinationTargetID, code, message)
}
func (c *SetShowPaintRectsCommand) Respond() {
c.conn.SendResult(c.responseId, c.DestinationTargetID, struct{}{})
}
type SetShowDebugBordersCommand struct {
DestinationTargetID string
responseId int64
conn *shared.Connection
Show bool `json:"show"`// True for showing debug borders
}
type SetShowDebugBordersReturn struct {
}
func (c *SetShowDebugBordersCommand) Initalize(targetId string, responseId int64, conn *shared.Connection) {
c.DestinationTargetID = targetId
c.responseId = responseId
c.conn = conn
}
func (c *SetShowDebugBordersCommand) RespondWithError(code shared.ResponseErrorCodes, message string) {
c.conn.SendErrorResult(c.responseId, c.DestinationTargetID, code, message)
}
func (c *SetShowDebugBordersCommand) Respond() {
c.conn.SendResult(c.responseId, c.DestinationTargetID, struct{}{})
}
type SetShowFPSCounterCommand struct {
DestinationTargetID string
responseId int64
conn *shared.Connection
Show bool `json:"show"`// True for showing the FPS counter
}
type SetShowFPSCounterReturn struct {
}
func (c *SetShowFPSCounterCommand) Initalize(targetId string, responseId int64, conn *shared.Connection) {
c.DestinationTargetID = targetId
c.responseId = responseId
c.conn = conn
}
func (c *SetShowFPSCounterCommand) RespondWithError(code shared.ResponseErrorCodes, message string) {
c.conn.SendErrorResult(c.responseId, c.DestinationTargetID, code, message)
}
func (c *SetShowFPSCounterCommand) Respond() {
c.conn.SendResult(c.responseId, c.DestinationTargetID, struct{}{})
}
type SetShowScrollBottleneckRectsCommand struct {
DestinationTargetID string
responseId int64
conn *shared.Connection
Show bool `json:"show"`// True for showing scroll bottleneck rects
}
type SetShowScrollBottleneckRectsReturn struct {
}
func (c *SetShowScrollBottleneckRectsCommand) Initalize(targetId string, responseId int64, conn *shared.Connection) {
c.DestinationTargetID = targetId
c.responseId = responseId
c.conn = conn
}
func (c *SetShowScrollBottleneckRectsCommand) RespondWithError(code shared.ResponseErrorCodes, message string) {
c.conn.SendErrorResult(c.responseId, c.DestinationTargetID, code, message)
}
func (c *SetShowScrollBottleneckRectsCommand) Respond() {
c.conn.SendResult(c.responseId, c.DestinationTargetID, struct{}{})
}
type SetShowViewportSizeOnResizeCommand struct {
DestinationTargetID string
responseId int64
conn *shared.Connection
Show bool `json:"show"`// Whether to paint size or not.
}
type SetShowViewportSizeOnResizeReturn struct {
}
func (c *SetShowViewportSizeOnResizeCommand) Initalize(targetId string, responseId int64, conn *shared.Connection) {
c.DestinationTargetID = targetId
c.responseId = responseId
c.conn = conn
}
func (c *SetShowViewportSizeOnResizeCommand) RespondWithError(code shared.ResponseErrorCodes, message string) {
c.conn.SendErrorResult(c.responseId, c.DestinationTargetID, code, message)
}
func (c *SetShowViewportSizeOnResizeCommand) Respond() {
c.conn.SendResult(c.responseId, c.DestinationTargetID, struct{}{})
}