diff options
| -rw-r--r-- | world.rhm | 14 | 
1 files changed, 12 insertions, 2 deletions
@@ -5,16 +5,26 @@ export:      Entity      World +enum Direction: +    north +    north_east +    east +    south_east +    south +    south_west +    west +    north_west +  class Chunk(width :: Int,              height :: Int,              offset_x :: Int,              offset_y :: Int,              tiles :: Array.now_of(Int), -            neighbours :: MutableMap.now_of(Symbol, Chunk)): +            neighbours :: MutableMap.now_of(Direction, Chunk)):      constructor(width :: Int, height :: Int, offset_x :: Int, offset_y :: Int):          super(width, height, offset_x, offset_y, Array.make(width * height, 0), MutableMap()) -    method add_neighbour(chunk :: Chunk, direction :: Symbol): +    method add_neighbour(chunk :: Chunk, direction :: Direction):          neighbours[direction] := chunk      method get_tile(x :: Int, y :: Int):  |