本文整理汇总了C++中ObjectTypeManager::addNewObjectType方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectTypeManager::addNewObjectType方法的具体用法?C++ ObjectTypeManager::addNewObjectType怎么用?C++ ObjectTypeManager::addNewObjectType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectTypeManager
的用法示例。
在下文中一共展示了ObjectTypeManager::addNewObjectType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initGame
void MTSec::initGame() {
Game* game = Game::getGame();
MTSecTurn* turn = new MTSecTurn();
game->setTurnProcess(turn);
ObjectTypeManager* obdm = game->getObjectTypeManager();
obdm->addNewObjectType( new UniverseType());
obdm->addNewObjectType( new EmptyObjectType( "Galaxy", "The Galaxy Object type") );
obdm->addNewObjectType( new EmptyObjectType( "Star System","The Star System Object type") );
uint32_t pt = obdm->addNewObjectType( new PlanetType());
uint32_t ft = obdm->addNewObjectType( new FleetType());
turn->setPlanetType(pt);
turn->setFleetType(ft);
OrderManager* ordm = game->getOrderManager();
ordm->addOrderType(new Nop());
ordm->addOrderType(new Move());
ordm->addOrderType(new BuildFleet());
ordm->addOrderType(new BuildWeapon());
ordm->addOrderType(new Colonise());
ordm->addOrderType(new SplitFleet());
ordm->addOrderType(new MergeFleet());
ordm->addOrderType(new Enhance());
ordm->addOrderType(new SendPoints());
ordm->addOrderType(new LoadArmament());
ordm->addOrderType(new UnloadArmament());
}
示例2: initGame
void taeRuleset::initGame() {
Game* game = Game::getGame();
fleetBuilder = new FleetBuilder();
//Setup turns
TaeTurn* turn = new TaeTurn(fleetBuilder);
game->setTurnProcess(turn);
//Add universe object type
ObjectTypeManager* obtm = game->getObjectTypeManager();
obtm->addNewObjectType(new UniverseType());
//Add Galaxy object type
EmptyObjectType * eo = new EmptyObjectType();
eo->setTypeName("Galaxy");
eo->setTypeDescription("The Galaxy Object type");
obtm->addNewObjectType(eo);
//Add Solar system object type
obtm->addNewObjectType(new StarSystemType());
//Add Planet object type
uint32_t pt = obtm->addNewObjectType(new PlanetType());
turn->setPlanetType(pt);
//Add Fleet object type
uint32_t ft = obtm->addNewObjectType(new FleetType());
turn->setFleetType(ft);
//Set Order types
OrderManager* orm = game->getOrderManager();
orm->addOrderType(new Colonize(true));
orm->addOrderType(new Colonize(false));
orm->addOrderType(new Move());
orm->addOrderType(new Attack());
orm->addOrderType(new Reinforce());
Logger::getLogger()->info("TaE initialised");
}