Exemplo n.º 1
0
/**
 * @brief Constructor.
 * @param map The map containing the entity.
 * @param index Index of the entity in the map.
 */
Npc::Npc(MapModel& map, const EntityIndex& index) :
  EntityModel(map, index, EntityType::NPC) {

  set_origin(QPoint(8, 13));

  set_num_directions(4);
  set_no_direction_allowed(true);
  set_no_direction_text(MapModel::tr("Any"));

  SubtypeList subtypes = {
    { "0", MapModel::tr("Generalized NPC (something)") },
    { "1", MapModel::tr("Usual NPC (somebody)") }
  };
  set_existing_subtypes(subtypes);
  set_traversable(false);
}
/**
 * @brief Constructor.
 * @param map The map containing the entity.
 * @param index Index of the entity in the map.
 */
CustomEntity::CustomEntity(MapModel& map, const EntityIndex& index) :
  EntityModel(map, index, EntityType::CUSTOM) {

  set_origin(QPoint(8, 13));
  set_base_size(QSize(8, 8));
  set_resizable(true);

  set_num_directions(4);

  DrawShapeInfo info;
  info.enabled = true;
  info.background_color = QColor(224, 108, 72);
  info.between_border_color = QColor(184, 96, 96);
  info.pixmap = QPixmap(":/images/entity_custom_resizable.png");
  set_draw_shape_info(info);
}
Exemplo n.º 3
0
/**
 * @brief Constructor.
 * @param map The map containing the entity.
 * @param index Index of the entity in the map.
 */
Door::Door(MapModel& map, const EntityIndex& index) :
  EntityModel(map, index, EntityType::DOOR) {

  set_num_directions(4);
}