space calculation

This commit is contained in:
Aaron Mueller 2014-12-07 00:46:46 +01:00
parent c6619f1247
commit fe496a24d4
4 changed files with 17 additions and 0 deletions

View file

@ -7,3 +7,5 @@ class Base
isMoveable: -> isMoveable: ->
false false
spaceProvided: 50

View file

@ -7,3 +7,5 @@ class Miner
isMoveable: -> isMoveable: ->
true true
spaceProvided: 5

View file

@ -17,3 +17,5 @@ class Silo
else else
@frame += 1 @frame += 1
spaceProvided: 150

View file

@ -71,6 +71,17 @@ app.game =
miners: [] miners: []
maxTileAmount: 15 maxTileAmount: 15
availableSiloStorage: ->
space = 0
for tile in app.game.map
space += tile.spaceProvided
space
usedSiloStorage: ->
space = 0
space += amount for resource, amount of @resources
space
resources: resources:
stardust: 0 stardust: 0
dirt: 0 dirt: 0