| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- package board
- type Tile byte
- type jsonTile struct {
- X int `json:"x"`
- Y int `json:"y"`
- Type string `json:"type"`
- Player string `json:"player,omitempty"`
- }
- const (
- Water Tile = '~'
- Ice Tile = '*'
- Rock Tile = '^'
- Iglo Tile = 'O'
- )
- func (t Tile) String() string {
- switch t {
- case Water:
- return "~"
- case Rock:
- return "▲"
- case Ice:
- return "*"
- case Iglo:
- return "⌂"
- }
- panic("Unknown tile type")
- }
- func (t Tile) Name() string {
- switch t {
- case Water:
- return "W"
- case Rock:
- return "R"
- case Ice:
- return "I"
- case Iglo:
- return "H"
- }
- panic("Unknown tile type")
- }
|