robinheghan/elm-warrior/1.0.1

Formerly Skinney/elm-warrior. Search finds this package by either name.

Warrior.Map.Tile

A map is built of several tiles. You can use this module to get a better idea of how the map is made up.

type Tile
= Wall
| Empty
| SpawnPoint
| Exit
| Warrior String
| Item Item

Describes what is on a specific coordinate of a map.

Predicates

Sometimes a pattern match is a bit much when all you want is the answer to a simple question. So here are simple predicate functions that make it easy to answer the most basic question about a tile.

isWall : Tile -> Bool

True if the given Tile is a Wall

isEmpty : Tile -> Bool

True if the given Tile represents Empty space

isSpawnPoint : Tile -> Bool

True if the given Tile is a spawn point

isExit : Tile -> Bool

True if the given Tile is an exit point

isWarrior : Tile -> Bool

True if the given Tile represents another warrior

isItem : Tile -> Bool

True if the given Tile represents an item

canMoveOnto : Tile -> Bool

True if a warrior can move to this tile with a move action.