diff options
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/Direction.coffee | 13 | ||||
-rw-r--r-- | src/model/Entity.coffee | 8 | ||||
-rw-r--r-- | src/model/EntityPosition.coffee | 8 | ||||
-rw-r--r-- | src/model/MapData.coffee (renamed from src/model/Map.coffee) | 5 | ||||
-rw-r--r-- | src/model/Position.coffee | 10 |
5 files changed, 42 insertions, 2 deletions
diff --git a/src/model/Direction.coffee b/src/model/Direction.coffee new file mode 100644 index 0000000..5c49c80 --- /dev/null +++ b/src/model/Direction.coffee @@ -0,0 +1,13 @@ +'use strict' + + +Direction = + NORTH: 0 + EAST: 1 + SOUTH: 2 + WEST: 3 + + reverse: (d) -> (d+2)%4 + + +module.exports = Direction diff --git a/src/model/Entity.coffee b/src/model/Entity.coffee new file mode 100644 index 0000000..70c81fa --- /dev/null +++ b/src/model/Entity.coffee @@ -0,0 +1,8 @@ +'use strict' + + +class Entity + constructor: (@name) -> + + +module.exports = Entity diff --git a/src/model/EntityPosition.coffee b/src/model/EntityPosition.coffee new file mode 100644 index 0000000..aaf9531 --- /dev/null +++ b/src/model/EntityPosition.coffee @@ -0,0 +1,8 @@ +'use strict' + + +class EntityPosition + constructor: (@entity, @position, @direction) -> + + +module.exports = EntityPosition diff --git a/src/model/Map.coffee b/src/model/MapData.coffee index e97b1ed..39b2140 100644 --- a/src/model/Map.coffee +++ b/src/model/MapData.coffee @@ -1,8 +1,9 @@ 'use strict' -class Map + +class MapData constructor: (data) -> {@tiles, @collition, @layers} = data -module.exports = Map +module.exports = MapData diff --git a/src/model/Position.coffee b/src/model/Position.coffee new file mode 100644 index 0000000..08bb999 --- /dev/null +++ b/src/model/Position.coffee @@ -0,0 +1,10 @@ +'use strict' + + +class Position + constructor: (@x, @y) -> + + asString: => "#{@x},#{@y}" + + +module.exports = Position |