diff --git a/soko/entitytype.go b/soko/entitytype.go new file mode 100644 index 0000000..6be1485 --- /dev/null +++ b/soko/entitytype.go @@ -0,0 +1,23 @@ +package soko + +type EntityType byte + +const ( + EntityTypeInvalid EntityType = EntityType(0) + EntityTypeNone = '_' + EntityTypeCharacter = '@' + EntityTypeEgg = 'X' + EntityTypeBrick = 'B' +) + +func (e EntityType) IsValid() bool { + switch e { + case EntityTypeNone: + case EntityTypeCharacter: + case EntityTypeEgg: + case EntityTypeBrick: + default: + return false + } + return true +} diff --git a/soko/level.go b/soko/level.go index beaed7a..a681746 100644 --- a/soko/level.go +++ b/soko/level.go @@ -4,47 +4,6 @@ import ( "opslag.de/schobers/geom" ) -type EntityType byte -type Tile byte - -const ( - EntityTypeInvalid EntityType = EntityType(0) - EntityTypeNone = '_' - EntityTypeCharacter = '@' - EntityTypeEgg = 'X' - EntityTypeBrick = 'B' -) - -func (e EntityType) IsValid() bool { - switch e { - case EntityTypeNone: - case EntityTypeCharacter: - case EntityTypeEgg: - case EntityTypeBrick: - default: - return false - } - return true -} - -const ( - TileInvalid Tile = Tile(0) - TileNothing = '.' - TileBasic = '#' - TileMagma = '~' -) - -func (t Tile) IsValid() bool { - switch t { - case TileNothing: - case TileBasic: - case TileMagma: - default: - return false - } - return true -} - type Level struct { Width int Height int diff --git a/soko/tile.go b/soko/tile.go new file mode 100644 index 0000000..af92fc8 --- /dev/null +++ b/soko/tile.go @@ -0,0 +1,21 @@ +package soko + +type Tile byte + +const ( + TileInvalid Tile = Tile(0) + TileNothing = '.' + TileBasic = '#' + TileMagma = '~' +) + +func (t Tile) IsValid() bool { + switch t { + case TileNothing: + case TileBasic: + case TileMagma: + default: + return false + } + return true +}