本文整理汇总了C#中GameObjects.GameArea.AddPoint方法的典型用法代码示例。如果您正苦于以下问题:C# GameArea.AddPoint方法的具体用法?C# GameArea.AddPoint怎么用?C# GameArea.AddPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObjects.GameArea
的用法示例。
在下文中一共展示了GameArea.AddPoint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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.IsFriendlyWithoutTruce(architectureByPosition.BelongedFaction)))
{
BlackAngles.Add(point);
return;
}
}
if (!IsInBlackAngle(Area.Centre, BlackAngles, point))
{
Area.AddPoint(point);
}
}
else
{
BlackAngles.Add(point);
}
}
}
示例2: GetArea
public static GameArea GetArea(Point Centre, int Radius, bool Oblique)
{
GameArea area = new GameArea();
List<float> list = new List<float>();
area.Centre = Centre;
for (int i = -Radius; i <= Radius; i++)
{
for (int j = -Radius; j <= Radius; j++)
{
if (Oblique)
{
area.AddPoint(new Point(Centre.X + i, Centre.Y + j));
}
else if ((Math.Abs(i) + Math.Abs(j)) <= Radius)
{
area.AddPoint(new Point(Centre.X + i, Centre.Y + j));
}
}
}
return area;
}
示例3: GetDayArea
public GameArea GetDayArea(Troop troop, int Days)
{
GameArea area = new GameArea();
openDictionary.Clear();
openList.Clear();
closeDictionary.Clear();
closeList.Clear();
GameSquare square = new GameSquare();
square.Position = troop.Position;
this.AddToCloseList(square);
int num = troop.Movability * Days;
int movabilityLeft = troop.MovabilityLeft;
//int num3 = troop.RealMovability * Days;
troop.MovabilityLeft = num;
MilitaryKind kind = troop.Army.Kind;
do
{
CheckAdjacentSquares(square, troop.Position, false, kind);
if (this.openList.Count == 0)
{
break;
}
square = this.AddToCloseList();
if (square == null)
{
break;
}
if (num >= square.G)
{
if (!troop.Scenario.PositionIsTroop(square.Position))
{
area.AddPoint(square.Position);
}
}
else
{
break;
}
if (closeList.Count > 2500 || closeDictionary.Count > 2500) break;
} while (true);
troop.MovabilityLeft = movabilityLeft;
saveLastPath();
openDictionary.Clear();
openList.Clear();
closeDictionary.Clear();
closeList.Clear();
return area;
}
示例4: GetArea
public static GameArea GetArea(Point Centre, int Radius, bool Oblique)
{
GameArea area = new GameArea();
List<float> list = new List<float>();
area.Centre = Centre;
if (Oblique)
{
for (int i = Centre.X - Radius; i <= Centre.X + Radius; i++)
{
for (int j = Centre.Y - Radius; j <= Centre.Y + Radius; j++)
{
area.AddPoint(new Point(i, j));
}
}
}
else
{
for (int i = -Radius; i <= Radius; i++)
{
if (i <= 0)
{
for (int j = -Radius - i; j <= i + Radius; j++)
{
area.AddPoint(new Point(Centre.X + i, Centre.Y + j));
}
}
else
{
for (int j = i - Radius; j <= Radius - i; j++)
{
area.AddPoint(new Point(Centre.X + i, Centre.Y + j));
}
}
}
}
return area;
}
示例5: GetAllAvailableArea
public GameArea GetAllAvailableArea(bool Square)
{
GameArea area = new GameArea();
foreach (Point point in this.ContactArea.Area)
{
if (base.Scenario.IsPositionEmpty(point) && base.Scenario.GetTerrainDetailByPosition(point) != null && base.Scenario.GetTerrainDetailByPosition(point).RoutewayConsumptionRate < 1)
{
area.AddPoint(point);
}
}
foreach (Point point in this.ArchitectureArea.Area)
{
if (!base.Scenario.PositionIsTroop(point) && base.Scenario.GetTerrainDetailByPosition(point) != null && base.Scenario.GetTerrainDetailByPosition(point).RoutewayConsumptionRate < 1)
{
area.AddPoint(point);
}
}
return area;
}
示例6: GetAIRoutewayEndPoints
public GameArea GetAIRoutewayEndPoints(Architecture a, bool nowater)
{
GameArea area = new GameArea();
if (!this.IsFriendly(a.BelongedFaction))
{
foreach (Point point in this.ContactArea.Area)
{
if (a.IsRoutewayPossible(point) && (!nowater || (base.Scenario.GetTerrainKindByPosition(point) != TerrainKind.水域)))
{
area.AddPoint(point);
}
}
}
if (area.Count == 0)
{
foreach (Point point in this.GetRoutewayStartArea().Area)
{
if (a.IsRoutewayPossible(point) && (!nowater || (base.Scenario.GetTerrainKindByPosition(point) != TerrainKind.水域)))
{
area.AddPoint(point);
}
}
}
if (area.Count == 0)
{
foreach (Point point in this.LongViewArea.Area)
{
if (a.IsRoutewayPossible(point))
{
area.AddPoint(point);
}
}
}
return area;
}
示例7: GetAllAvailableArea
public GameArea GetAllAvailableArea(bool Square)
{
GameArea area = new GameArea();
foreach (Point point in this.ContactArea.Area)
{
if (base.Scenario.IsPositionEmpty(point))
{
area.AddPoint(point);
}
}
foreach (Point point in this.ArchitectureArea.Area)
{
if (!base.Scenario.PositionIsTroop(point))
{
area.AddPoint(point);
}
}
return area;
}
示例8: GetGossipArchitectureArea
public GameArea GetGossipArchitectureArea()
{
GameArea area = new GameArea();
foreach (Architecture architecture in base.Scenario.Architectures)
{
if ((((architecture.BelongedFaction != null) && !this.IsFriendly(architecture.BelongedFaction)) && architecture.HasPerson()) && this.BelongedFaction.IsArchitectureKnown(architecture))
{
foreach (Point point in architecture.ArchitectureArea.Area)
{
area.AddPoint(point);
}
}
}
return area;
}
示例9: GetJailBreakArchitectureArea
public GameArea GetJailBreakArchitectureArea()
{
GameArea area = new GameArea();
foreach (Architecture architecture in base.Scenario.Architectures)
{
if (architecture.BelongedFaction != null && !this.IsFriendly(architecture.BelongedFaction) && architecture.HasFactionCaptive(this.BelongedFaction))
{
foreach (Point point in architecture.ArchitectureArea.Area)
{
area.AddPoint(point);
}
}
}
return area;
}
示例10: GetRoutewayWaterOrientation
private Point? GetRoutewayWaterOrientation(Routeway routeway, Architecture des)
{
GameArea area = new GameArea();
foreach (Point point in des.ContactArea.Area)
{
TerrainDetail terrainDetailByPosition = base.Scenario.GetTerrainDetailByPosition(point);
if ((terrainDetailByPosition != null) && (terrainDetailByPosition.ID == 6))
{
if (routeway.GetPoint(point) != null)
{
continue;
}
area.AddPoint(point);
}
}
if (area.Count > 0)
{
return new Point?(base.Scenario.GetClosestPoint(area, this.Position));
}
return null;
}
示例11: GetConvincePersonArchitectureArea
public GameArea GetConvincePersonArchitectureArea()
{
GameArea area = new GameArea();
//Label_0121:
foreach (Architecture architecture in base.Scenario.Architectures)
{
if (architecture.BelongedFaction == this.BelongedFaction)
{
if (!architecture.HasCaptive() && !architecture.HasNoFactionPerson())
{
//goto Label_0121;
continue;
}
foreach (Point point in architecture.ArchitectureArea.Area)
{
area.AddPoint(point);
}
}
else
{
if ((!architecture.HasPerson() && !architecture.HasNoFactionPerson()) || !this.BelongedFaction.IsArchitectureKnown(architecture))
{
continue;
}
foreach (Point point in architecture.ArchitectureArea.Area)
{
area.AddPoint(point);
}
}
}
return area;
}
示例12: GetruchengArea
public GameArea GetruchengArea(bool friendly)
{
GameArea area = new GameArea();
foreach (Architecture architecture in base.Scenario.Architectures)
{
if (this.IsFriendly(architecture.BelongedFaction) == friendly)
{
foreach (Point point in architecture.ArchitectureArea.Area)
{
area.AddPoint(point);
}
}
}
return area;
}
示例13: GetHighestFightingForceArea
public GameArea GetHighestFightingForceArea(GameArea sourceArea)
{
if (sourceArea == null)
{
return null;
}
int num = -2147483648;
GameArea area = new GameArea();
foreach (Point point in sourceArea.Area)
{
int fightingForce = CreateSimulateTroop(this.Persons, this.Army, point).FightingForce;
if (fightingForce > num)
{
num = fightingForce;
area.Area.Clear();
area.AddPoint(point);
}
else if (fightingForce == num)
{
area.AddPoint(point);
}
}
return area;
}
示例14: GetHighestFightingForceArea
public GameArea GetHighestFightingForceArea(GameArea sourceArea)
{
if (sourceArea == null || sourceArea.Count == 0)
{
return null;
}
int num = -2147483648;
GameArea area = new GameArea();
foreach (Point point in sourceArea.Area)
{
PersonList originalPersons = this.Persons;
Troop troop = CreateSimulateTroop(this.Candidates, this.Army, point);
int fightingForce = troop.FightingForce;
troop.Destroy(true, false);
if (fightingForce > num)
{
num = fightingForce;
area.Area.Clear();
area.AddPoint(point);
}
else if (fightingForce == num)
{
area.AddPoint(point);
}
foreach (Person p in originalPersons)
{
p.LocationTroop = this;
}
}
return area;
}
示例15: BuildThreeTierPath
private bool BuildThreeTierPath(MilitaryKind kind)
{
bool path = false;
if (!this.HasPath)
{
if (this.BelongedFaction != null && !base.Scenario.IsPlayer(this.BelongedFaction) && this.TargetArchitecture == null && !this.IsViewingWillArchitecture() &&
this.TargetTroop == null && this.BelongedLegion != null && this.BelongedLegion.Kind == LegionKind.Offensive)
{
MilitaryKind trueKind = this.Army.KindID == 28 ? this.Army.RealMilitaryKind : this.Army.Kind;
List<Point> refPath = null;
bool aapUsable = this.StartingArchitecture.GetAllContactArea().Area.Contains(this.Position);
if (aapUsable && base.Scenario.pathCache.ContainsKey(new PathCacheKey(this.StartingArchitecture, this.WillArchitecture, trueKind)))
{
refPath = base.Scenario.pathCache[new PathCacheKey(this.StartingArchitecture, this.WillArchitecture, trueKind)];
}
if (refPath != null && refPath.Count > 0 && aapUsable)
{
path = ConstructTruePath(refPath, kind);
}
else if (refPath == null && (this.StartingArchitecture != this.WillArchitecture || !aapUsable))
{
Point? p1;
Point? p2;
// 出发建筑的点应该包括建筑邻近的点
GameArea startingArea = new GameArea();
foreach (Point p in this.StartingArchitecture.ContactArea.Area)
startingArea.AddPoint(p);
foreach (Point p in this.StartingArchitecture.ArchitectureArea.Area)
startingArea.AddPoint(p);
startingArea.Centre = this.StartingArchitecture.ArchitectureArea.Centre;
GameArea willArea = new GameArea();
foreach (Point p in this.WillArchitecture.ArchitectureArea.Area)
willArea.AddPoint(p);
willArea.Centre = this.WillArchitecture.ArchitectureArea.Centre;
base.Scenario.GetClosestPointsBetweenTwoAreas(startingArea, willArea, out p1, out p2);
if (p1.HasValue && p2.HasValue)
{
bool ftPath = this.pathFinder.GetFirstTierPath(p1.Value, p2.Value, kind);
if (ftPath)
{
if (this.FirstTierPath != null && this.FirstTierPath.Count > 0)
{
// 去除多余的点
int i = 0;
while (startingArea.HasPoint(this.FirstTierPath[i]))
{
i++;
if (i >= this.FirstTierPath.Count)
{
i = this.FirstTierPath.Count - 1;
break;
}
}
this.FirstTierPath.RemoveRange(0, i);
i = this.FirstTierPath.Count - 1;
while (willArea.HasPoint(this.FirstTierPath[i]))
{
i--;
if (i < 0)
{
i = 0;
break;
}
}
this.FirstTierPath.RemoveRange(i + 1, this.FirstTierPath.Count - i - 1);
if (aapUsable)
{
base.Scenario.pathCache[new PathCacheKey(this.StartingArchitecture, this.WillArchitecture, this.Army.Kind)] = this.FirstTierPath;
}
path = ConstructTruePath(this.FirstTierPath, kind);
}
else
{
if (aapUsable)
{
base.Scenario.pathCache[new PathCacheKey(this.StartingArchitecture, this.WillArchitecture, this.Army.Kind)] = new List<Point>();
}
}
}
}
}
else if (refPath == null || (refPath.Count == 0 && this.Army.Kind.Type != MilitaryType.水军))
{
this.StartingArchitecture.actuallyUnreachableArch.Add(this.WillArchitecture);
this.GoBack();
return false;
}
}
if (!path)
{
this.EnableOneAdaptablility = true;
bool flag2 = false;
if ((this.BelongedFaction != null) && !GameObject.Chance(0x21))
{
flag2 = true;
foreach (Troop troop in this.BelongedFaction.Troops)
//.........这里部分代码省略.........