diff options
Diffstat (limited to 'go/game/tile.go')
| -rw-r--r-- | go/game/tile.go | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/go/game/tile.go b/go/game/tile.go index 50688d83..b8e8c83f 100644 --- a/go/game/tile.go +++ b/go/game/tile.go @@ -2,7 +2,6 @@ package game import ( "log" - "strconv" "strings" ) @@ -62,27 +61,19 @@ var TileNames = map[string]TileType{ type Tile struct { Position Position - Permanent *Permanent + Permanent Permanent Type TileType Raw string - PlayerId int } func INVALID_TILE() Tile { - return Tile{INVALID_POSITION(), nil, 0, "", -1} + return Tile{INVALID_POSITION(), nil, 0, ""} } func NewTileFromString(tile string, pos Position) (Tile, error) { tokens := strings.Split(tile, " ") tileType := TileNames[strings.ToLower(tokens[0])] - t := Tile{pos, nil, tileType, tile, -1} - if tokens[0] == "spawn" { - playerId, err := strconv.Atoi(tokens[2]) - if err != nil { - return INVALID_TILE(), err - } - t.PlayerId = playerId - } + t := Tile{pos, nil, tileType, tile} return t, nil } |
