コード例 #1
0
ファイル: OgrWriter.cpp プロジェクト: giserh/hootenanny
void OgrWriter::setConfiguration(const Settings& conf)
{
  setCreateAllLayers(conf.getBool(createAllLayersKey(), false));
  setScriptPath(conf.getString(scriptKey(), ""));
  setPrependLayerName(conf.getString(preLayerNameKey(), ""));

  _appendData = ConfigOptions(conf).getOgrAppendData();

  QString strictStr = conf.getString(strictCheckingKey(), strictCheckingDefault());
  if (strictStr == "on")
  {
    _strictChecking = StrictOn;
  }
  else if (strictStr == "off")
  {
    _strictChecking = StrictOff;
  }
  else if (strictStr == "warn")
  {
    _strictChecking = StrictWarn;
  }
  else
  {
    throw HootException("Error setting strict checking. Expected on/off/warn. got: " + strictStr);
  }
}
コード例 #2
0
int SquadBindings::apiCreateDefendAreaTask(apikey squadKey, const glm::vec3& point, float range) {
    Squad* squad = m_scriptEngine.get<Squad>(squadKey);

    if (!squad) { return -1; }

    auto task = std::shared_ptr<DefendAreaTask>(new DefendAreaTask(*squad, { point }, range));
    m_scriptEngine.registerScriptable(task.get());

    squad->setTask(task);

    return task->scriptKey();
}
コード例 #3
0
int SquadBindings::apiCreatePatrolWaypointsTask(apikey squadKey) {
    Squad* squad = m_scriptEngine.get<Squad>(squadKey);

    if (!squad) { return -1; }

    auto task = std::make_shared<PatrolWaypointsTask>(*squad);
    m_scriptEngine.registerScriptable(task.get());

    squad->setTask(task);

    return task->scriptKey();
}
コード例 #4
0
apikey SquadBindings::apiCreateSquad(apikey leader) {
    Ship* ship = m_scriptEngine.get<Ship>(leader);

    if (!ship) { return -1; }

    auto squad = std::make_shared<Squad>();
    m_scriptEngine.registerScriptable(squad.get());

    ship->squadLogic()->joinSquad(squad);

    return squad->scriptKey();
}