예제 #1
0
파일: Chest.cpp 프로젝트: Aerospyke/solarus
/**
 * @brief This function is called by the engine when an entity overlaps the chest.
 *
 * This is a redefinition of Detector::notify_collision().
 * If the entity is the hero, and if he is facing north, we allow him to
 * open (or try to open) the chest.
 *
 * @param entity_overlapping the entity overlapping the detector
 * @param collision_mode the collision mode that detected the collision
 */
void Chest::notify_collision(MapEntity &entity_overlapping, CollisionMode collision_mode) {

  if (is_suspended() || !is_visible()) {
    return;
  }

  entity_overlapping.notify_collision_with_chest(*this);
}
예제 #2
0
/**
 * @brief This function is called by the engine when an entity overlaps the chest.
 * @param entity_overlapping the entity overlapping the detector
 * @param collision_mode the collision mode that detected the collision
 */
void Chest::notify_collision(MapEntity& entity_overlapping, CollisionMode collision_mode) {

  if (!is_suspended()) {
    entity_overlapping.notify_collision_with_chest(*this);
  }
}