本文整理汇总了C#中GameObjects.GameArea.CombineArea方法的典型用法代码示例。如果您正苦于以下问题:C# GameArea.CombineArea方法的具体用法?C# GameArea.CombineArea怎么用?C# GameArea.CombineArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObjects.GameArea
的用法示例。
在下文中一共展示了GameArea.CombineArea方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAreaFromArea
public static GameArea GetAreaFromArea(GameArea area, int radius, bool oblique, GameScenario Scenario, Faction faction)
{
/*int longRadius;
if (area.Count <= 1)
longRadius = radius;
else if (area.Count <= 5)
longRadius = radius + 1;
else
longRadius = radius + 2;
GameArea candidateArea = GetArea(area.Centre, longRadius, oblique);
if (longRadius >= (radius + 1))
{
candidateArea.Area.Remove(new Point(area.Centre.X - longRadius, area.Centre.Y - longRadius));
candidateArea.Area.Remove(new Point(area.Centre.X - longRadius, area.Centre.Y + longRadius));
candidateArea.Area.Remove(new Point(area.Centre.X + longRadius, area.Centre.Y - longRadius));
candidateArea.Area.Remove(new Point(area.Centre.X + longRadius, area.Centre.Y + longRadius));
}
if (longRadius >= (radius + 2))
{
candidateArea.Area.Remove(new Point(area.Centre.X - longRadius + 1, area.Centre.Y - longRadius));
candidateArea.Area.Remove(new Point(area.Centre.X - longRadius, area.Centre.Y - longRadius + 1));
candidateArea.Area.Remove(new Point(area.Centre.X - longRadius + 1, area.Centre.Y + longRadius));
candidateArea.Area.Remove(new Point(area.Centre.X - longRadius, area.Centre.Y + longRadius - 1));
candidateArea.Area.Remove(new Point(area.Centre.X + longRadius - 1, area.Centre.Y - longRadius));
candidateArea.Area.Remove(new Point(area.Centre.X + longRadius, area.Centre.Y - longRadius + 1));
candidateArea.Area.Remove(new Point(area.Centre.X + longRadius - 1, area.Centre.Y + longRadius));
candidateArea.Area.Remove(new Point(area.Centre.X + longRadius, area.Centre.Y + longRadius - 1));
}
return candidateArea;*/
Dictionary<Point, object> closedList = new Dictionary<Point, object>();
GameArea area2 = new GameArea();
foreach (Point point in area.Area)
{
area2.CombineArea(GetViewArea(point, radius, oblique, Scenario, faction), closedList);
}
foreach (Point point in closedList.Keys)
{
area2.Area.Add(point);
}
return area2;
}
示例2: GetAreaFromArea
public static GameArea GetAreaFromArea(GameArea area, int Radius, bool Oblique, GameScenario Scenario, Faction faction)
{
Dictionary<Point, object> closedList = new Dictionary<Point, object>();
GameArea area2 = new GameArea();
foreach (Point point in area.Area)
{
area2.CombineArea(GetViewArea(point, Radius, Oblique, Scenario, faction), closedList);
}
foreach (Point point in closedList.Keys)
{
area2.Area.Add(point);
}
return area2;
}