def stepEnv()

in jsuarez/PCHandler.py [0:0]


   def stepEnv(self, env, entity):
      r, c = entity.pos
      tile = env.tiles[r, c]
      '''
      if tile.mat.harvestable:
         for drop in env.harvest(r, c):
            entity.inv.add(*drop)
      '''
      #if (type(env.tiles[r, c].mat) in [Material.FOREST.value]):
      if (entity.food < entity.maxFood and type(env.tiles[r, c].mat) in [Material.FOREST.value]):
         if env.harvest(r, c):
            entity.food += 1
      if (entity.water < entity.maxWater and 
            Material.WATER.value in 
            AI.adjacentMats(env, entity.pos)):
         entity.water += 1