Exemplo n.º 1
0
void MapTests::makeItemBlockerArray(bool arrayToFill[MAP_X_CELLS][MAP_Y_CELLS]) {
  for(int y = MAP_Y_CELLS - 1; y >= 0; y--) {
    for(int x = MAP_X_CELLS - 1; x >= 0; x--) {
      arrayToFill[x][y] = !eng->map->featuresStatic[x][y]->canHaveItem();
    }
  }
  FeatureMob* f = NULL;
  const unsigned int FEATURE_MOBS_SIZE = eng->gameTime->getFeatureMobsSize();
  for(unsigned int i = 0; i < FEATURE_MOBS_SIZE; i++) {
    f = eng->gameTime->getFeatureMobAt(i);
    if(arrayToFill[f->getX()][f->getY()] == false) {
      arrayToFill[f->getX()][f->getY()] = !f->canHaveItem();
    }
  }
  //addActorsToBlockerArray(arrayToFill); //Why?
}
Exemplo n.º 2
0
bool BlocksItems::check(const FeatureMob& f) const {
  return f.canHaveItem() == false;
}