/
gameboard.go
45 lines (41 loc) · 995 Bytes
/
gameboard.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
package models
type GameBoard struct {
// Board *string `json:"data,omitempty"`
// PlayerOne *GamePlayer `json:"player_one,omitempty"`
// PlayerTwo *GamePlayer `json:"player_two,omitempty"`
}
type GamePlayer struct {
Id *int64 `json:"id,omitempty"`
Ships *[]Ship `json:"ships,omitempty"`
}
/*
{
"player_one" : {
"id" : 3,
"ships" : [
{
"size" : 5,
"hits" : [true, false, false, true, false],
"origin" : {
"x" : 14,
"y" : 8
},
"orientation" : 2,
"is_using_special" : true
},
{
"size" : 2,
"hits" : [false, true],
"origin" : {
"x" : 0,
"y" : 0
},
"orientation" : 0,
"is_using_special" : false
}
]
},
"player_two" : {
}
}
*/