本文整理汇总了C++中PlayerInfo::Unvisit方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerInfo::Unvisit方法的具体用法?C++ PlayerInfo::Unvisit怎么用?C++ PlayerInfo::Unvisit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerInfo
的用法示例。
在下文中一共展示了PlayerInfo::Unvisit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Apply
void GameEvent::Apply(PlayerInfo &player)
{
// Serialize the current reputation with other governments.
player.SetReputationConditions();
// Apply this event's ConditionSet to the player's conditions.
conditionsToApply.Apply(player.Conditions());
// Apply (and store a record of applying) this event's other general
// changes (e.g. updating an outfitter's inventory).
player.AddChanges(changes);
// Update the current reputation with other governments (e.g. this
// event's ConditionSet may have altered some reputations).
player.CheckReputationConditions();
for(const System *system : systemsToUnvisit)
player.Unvisit(system);
for(const Planet *planet : planetsToUnvisit)
player.Unvisit(planet);
// Perform visits after unvisits, as "unvisit <system>"
// will unvisit any planets in that system.
for(const System *system : systemsToVisit)
player.Visit(system);
for(const Planet *planet : planetsToVisit)
player.Visit(planet);
}
示例2: Apply
void GameEvent::Apply(PlayerInfo &player)
{
for(const auto &it : GameData::Governments())
{
int rep = it.second.Reputation();
player.Conditions()["reputation: " + it.first] = rep;
}
conditionsToApply.Apply(player.Conditions());
player.AddChanges(changes);
for(const auto &it : GameData::Governments())
{
int rep = it.second.Reputation();
int newRep = player.Conditions()["reputation: " + it.first];
if(rep != newRep)
it.second.AddReputation(newRep - rep);
}
for(const System *system : systemsToUnvisit)
player.Unvisit(system);
}