本文整理汇总了C++中Campaign::getPlayerRole方法的典型用法代码示例。如果您正苦于以下问题:C++ Campaign::getPlayerRole方法的具体用法?C++ Campaign::getPlayerRole怎么用?C++ Campaign::getPlayerRole使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Campaign
的用法示例。
在下文中一共展示了Campaign::getPlayerRole方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getVillainPlacement
VillainPlacement CampaignBuilder::getVillainPlacement(const Campaign& campaign, VillainType type) {
VillainPlacement ret { [&campaign](int x) { return campaign.sites.getBounds().getXRange().contains(x);}, none };
switch (campaign.getType()) {
case CampaignType::FREE_PLAY:
switch (type) {
case VillainType::LESSER:
ret.xPredicate = [](int x) { return x >= 5 && x < 12; };
break;
case VillainType::MAIN:
ret.xPredicate = [](int x) { return (x >= 1 && x < 5) || (x >= 12 && x < 16) ; };
break;
case VillainType::ALLY:
if (campaign.getPlayerRole() == PlayerRole::ADVENTURER)
ret.firstLocation = *considerStaticPlayerPos(campaign);
break;
default:
break;
}
break;
default:
break;
}
return ret;
}