本文整理汇总了C#中GameObjects.Faction.IsFriendly方法的典型用法代码示例。如果您正苦于以下问题:C# Faction.IsFriendly方法的具体用法?C# Faction.IsFriendly怎么用?C# Faction.IsFriendly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObjects.Faction
的用法示例。
在下文中一共展示了Faction.IsFriendly方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPositionMapCost
public int GetPositionMapCost(Faction faction, Point position)
{
Architecture architectureByPositionNoCheck = this.GetArchitectureByPositionNoCheck(position);
if (architectureByPositionNoCheck != null)
{
if ((architectureByPositionNoCheck.Endurance > 0) && (architectureByPositionNoCheck.BelongedFaction != faction))
{
return 0xdac;
}
return 5;
}
Troop troopByPositionNoCheck = this.GetTroopByPositionNoCheck(position);
if (troopByPositionNoCheck != null)
{
if (!((faction != null) && faction.IsFriendly(troopByPositionNoCheck.BelongedFaction)))
{
return 0xdac;
}
return 0;
}
if (this.PositionIsOnFire(position))
{
return 10;
}
return 0;
}
示例2: HostileViewingTroopsCount
public int HostileViewingTroopsCount(Faction faction)
{
if (this.ViewingTroops == null)
{
return 0;
}
int num = 0;
foreach (Troop troop in this.ViewingTroops)
{
if (((faction == null) && (troop.BelongedFaction != faction)) || ((faction != null) && !faction.IsFriendly(troop.BelongedFaction)))
{
num++;
}
}
return num;
}
示例3: CheckPoint
private static void CheckPoint(GameArea Area, List<Point> BlackAngles, Point point, GameScenario Scenario, Faction faction)
{
TerrainDetail terrainDetailByPosition = Scenario.GetTerrainDetailByPosition(point);
if (terrainDetailByPosition != null)
{
if (terrainDetailByPosition.ViewThrough)
{
if (faction != null)
{
Architecture architectureByPosition = Scenario.GetArchitectureByPosition(point);
if (!(architectureByPosition == null || architectureByPosition.Endurance <= 0 || faction.IsFriendly(architectureByPosition.BelongedFaction)))
{
BlackAngles.Add(point);
return;
}
}
if (!IsInBlackAngle(Area.Centre, BlackAngles, point))
{
Area.AddPoint(point);
}
}
else
{
BlackAngles.Add(point);
}
}
}