本文整理汇总了C++中ObjectPtr::changeOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPtr::changeOwner方法的具体用法?C++ ObjectPtr::changeOwner怎么用?C++ ObjectPtr::changeOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectPtr
的用法示例。
在下文中一共展示了ObjectPtr::changeOwner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void Game::test_tmp1()
{
ObjectPtr o;
const PlayerVector &players = this->getPlayers();
players[1]->setRace(RaceId::Juche);
players[2]->setRace(RaceId::Terran);
players[1]->increaseMinerals(50);
players[2]->increaseMinerals(50);
#if 1
for(int i = 0; i < 10; i++)
{
o = this->newObject(ObjectId::Resource_MineralField);
o->setPosition(50, 270 + i*44);
}
for(int i = 0; i < 10; i++)
{
o = this->newObject(ObjectId::Resource_MineralField);
o->setPosition(50 + i*64, 270 + 44*3);
}
#endif
o = this->newObject(ObjectId::Juche_RodongCorrectionalFacility);
o->changeOwner(players[1]);
o->setPosition(80, 100);
o = this->newObject(ObjectId::Terran_CommandCenter);
o->changeOwner(players[1]);
o->setPosition(470, 200);
o = this->newObject(ObjectId::Terran_CommandCenter);
o->changeOwner(players[2]);
o->setPosition(280, 270);
o = this->newObject(ObjectId::Zerg_Zergling);
o->changeOwner(players[1]);
o->setPosition(80, 50);
o->doOrder(new UnitOrder::Move(Coordinate(410, 250)));
ObjectPtr o_zergling = o;
o = this->newObject(ObjectId::Juche_AojiWorker);
o->changeOwner(players[1]);
o->setPosition(500, 130);
//o->doOrder(new UnitOrder::Move(Coordinate(210, 300)));
o->doOrder(new UnitOrder::Attack(o_zergling));
o = this->newObject(ObjectId::Juche_DaepodongLauncher);
o->changeOwner(players[1]);
o->setPosition(40, 40);
}