add setup command
This commit is contained in:
parent
64bab97c38
commit
b5fc903394
9
game.go
9
game.go
@ -142,6 +142,15 @@ func (g *Game) Start() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Setup puts the game in setup mode
|
||||||
|
func (g *Game) Setup() bool {
|
||||||
|
if g.State == gameLobby {
|
||||||
|
g.State = gameSetup
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (g *Game) move(x, y, s, t int) (bool, error) {
|
func (g *Game) move(x, y, s, t int) (bool, error) {
|
||||||
startPiece, err := g.Board.GetPiece(x, y)
|
startPiece, err := g.Board.GetPiece(x, y)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user