tile.go 486 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package board
  2. type Tile byte
  3. const (
  4. Water Tile = '~'
  5. Ice Tile = '*'
  6. Rock Tile = '^'
  7. Iglo Tile = 'O'
  8. )
  9. func (t Tile) String() string {
  10. switch t {
  11. case Water:
  12. return "~"
  13. case Rock:
  14. return "▲"
  15. case Ice:
  16. return "*"
  17. case Iglo:
  18. return "⌂"
  19. }
  20. panic("Unknown tile type")
  21. }
  22. func (t Tile) Name() string {
  23. switch t {
  24. case Water:
  25. return "WATER"
  26. case Rock:
  27. return "ROTS"
  28. case Ice:
  29. return "IJS"
  30. case Iglo:
  31. return "HUIS"
  32. }
  33. panic("Unknown tile type")
  34. }