summaryrefslogtreecommitdiffstats
path: root/src/model
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2016-01-06 08:52:06 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2016-01-06 08:52:06 +0100
commit4fa246628bd9e5911ae998162f0bdc724cc739d2 (patch)
treefade72830f5bc1cc8c76e5a78a8ae65290c37a8b /src/model
parent6ed351b495db9e9b86066a419df43dd959ae94d3 (diff)
downloadrpgedit-4fa246628bd9e5911ae998162f0bdc724cc739d2.tar
rpgedit-4fa246628bd9e5911ae998162f0bdc724cc739d2.zip
Add entity rendering
Diffstat (limited to 'src/model')
-rw-r--r--src/model/Direction.coffee13
-rw-r--r--src/model/Entity.coffee8
-rw-r--r--src/model/EntityPosition.coffee8
-rw-r--r--src/model/MapData.coffee (renamed from src/model/Map.coffee)5
-rw-r--r--src/model/Position.coffee10
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