|
@@ -37,7 +37,7 @@ func (g *Game) Join(p *player.Player) {
|
|
|
g.mutex.Unlock()
|
|
g.mutex.Unlock()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (g *Game) placePlayer(p *player.Player) *board.Coordinate {
|
|
|
|
|
|
|
+func (g *Game) placePlayer(p *player.Player) {
|
|
|
xRange := g.Board.Cols / 5
|
|
xRange := g.Board.Cols / 5
|
|
|
yRange := g.Board.Rows
|
|
yRange := g.Board.Rows
|
|
|
|
|
|
|
@@ -46,7 +46,9 @@ func (g *Game) placePlayer(p *player.Player) *board.Coordinate {
|
|
|
y := rand.Intn(yRange)
|
|
y := rand.Intn(yRange)
|
|
|
|
|
|
|
|
if g.isValidPlayerPos(x, y) {
|
|
if g.isValidPlayerPos(x, y) {
|
|
|
- return &board.Coordinate{x, y}
|
|
|
|
|
|
|
+ p.Pos.X = x
|
|
|
|
|
+ p.Pos.Y = y
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|