• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GameObjects.GameArea类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中GameObjects.GameArea的典型用法代码示例。如果您正苦于以下问题:C# GameArea类的具体用法?C# GameArea怎么用?C# GameArea使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GameArea类属于GameObjects命名空间,在下文中一共展示了GameArea类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
         }
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:27,代码来源:GameArea.cs


示例2: GetCreditWithPosition

 public override int GetCreditWithPosition(Troop source, out Point? position)
 {
     //position = 0;
     position = new Point(0, 0);
     TroopList hostileTroopsInView = source.GetHostileTroopsInView();
     TroopList list2 = new TroopList();
     foreach (Troop troop in hostileTroopsInView)
     {
         if ((troop.IsInArchitecture || !troop.DaysToReachPosition(source.Position, 1)) || (troop.Army.Kind.Type == MilitaryType.水军))
         {
             list2.Add(troop);
         }
     }
     foreach (Troop troop in list2)
     {
         hostileTroopsInView.Remove(troop);
     }
     if (hostileTroopsInView.Count == 0)
     {
         return 0;
     }
     List<Point> orientations = new List<Point>();
     int num = 0;
     foreach (Troop troop in hostileTroopsInView)
     {
         orientations.Add(troop.Position);
         num += troop.FightingForce;
     }
     int num2 = 0;
     int fightingForce = source.FightingForce;
     int num4 = source.TroopIntelligence + source.ChanceIncrementOfStratagem;
     if (num4 > 100)
     {
         num4 = 100;
     }
     num2 = (((GameObject.Square(num4) / 60) * num) / fightingForce) / 100;
     if (num2 > 0)
     {
         GameArea area = new GameArea();
         foreach (Point point in source.GetStratagemArea(source.Position).Area)
         {
             if (!source.Scenario.PositionIsOnFire(point) && (source.Scenario.IsPositionEmpty(point) && source.Scenario.IsFireVaild(point, false, MilitaryType.步兵)))
             {
                 area.Area.Add(point);
             }
         }
         if (area.Count > 0)
         {
             position = source.Scenario.GetClosestPosition(area, orientations);
         }
         else
         {
             num2 = 0;
         }
     }
     return num2;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:57,代码来源:InfluenceKind398.cs


示例3: CombineArea

 public void CombineArea(GameArea AreaToCombine, Dictionary<Point, object> ClosedList)
 {
     foreach (Point point in AreaToCombine.Area)
     {
         if (!ClosedList.ContainsKey(point))
         {
             ClosedList.Add(point, null);
         }
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:10,代码来源:GameArea.cs


示例4: 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;
 }
开发者ID:simon217,项目名称:ZhongHuaSanGuoZhi,代码行数:14,代码来源:GameArea.cs


示例5: 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;
 }
开发者ID:kanjianlema,项目名称:ZhongHuaSanGuoZhi,代码行数:48,代码来源:TierPathFinder.cs


示例6: 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;
 }
开发者ID:simon217,项目名称:ZhongHuaSanGuoZhi,代码行数:21,代码来源:GameArea.cs


示例7: 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;
 }
开发者ID:k45399735,项目名称:ZhongHuaSanGuoZhi,代码行数:37,代码来源:GameArea.cs


示例8: IsActiveInArea

 public bool IsActiveInArea(GameArea area, out float minRate)
 {
     minRate = 1f;
     bool flag = false;
     LinkedListNode<RoutePoint> activeNode = null;
     foreach (Point point in area.Area)
     {
         activeNode = this.GetActiveNode(point);
         if (activeNode != null)
         {
             flag = true;
             if (activeNode.Value.ConsumptionRate < minRate)
             {
                 minRate = activeNode.Value.ConsumptionRate;
             }
         }
     }
     return flag;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:19,代码来源:Routeway.cs


示例9: SetLongViewArea

 public void SetLongViewArea(GameArea area)
 {
     this.longViewArea = area;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:4,代码来源:Architecture.cs


示例10: HasRelationUnderZeroHostileTroopsInView

 public bool HasRelationUnderZeroHostileTroopsInView()
 {
     if (this.BelongedFaction != null)
     {
         GameArea viewArea = this.ViewArea;
         if (this.Kind.HasLongView && (this.ArmyScale < this.NormalArmyScale))
         {
             viewArea = this.LongViewArea;
         }
         foreach (Point point in viewArea.Area)
         {
             Troop troopByPosition = base.Scenario.GetTroopByPosition(point);
             if ((((troopByPosition != null) && (troopByPosition.BelongedFaction != null)) && (troopByPosition.Status != TroopStatus.埋伏)) && (base.Scenario.GetDiplomaticRelation(this.BelongedFaction.ID, troopByPosition.BelongedFaction.ID) < 0))
             {
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:20,代码来源:Architecture.cs


示例11: GetTroopEnterableArea

 public GameArea GetTroopEnterableArea(Troop troop)
 {
     GameArea area = new GameArea();
     foreach (Point point in this.ArchitectureArea.Area)
     {
         if (base.Scenario.GetWaterPositionMapCost(troop.Army.Kind.Type, point) < 3500)
         {
             area.AddPoint(point);
         }
     }
     foreach (Point point in this.ContactArea.Area)
     {
         if (troop.IsMovableOnPosition(point) && (base.Scenario.GetWaterPositionMapCost(troop.Army.Kind.Type, point) < 3500))
         {
             area.AddPoint(point);
         }
     }
     return area;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:19,代码来源:Architecture.cs


示例12: GetRoutewayStartPoints

 public GameArea GetRoutewayStartPoints()
 {
     GameArea area = new GameArea();
     foreach (Point point in this.GetRoutewayStartArea().Area)
     {
         if (this.IsRoutewayPossible(point))
         {
             area.AddPoint(point);
         }
     }
     if (area.Count == 0)
     {
         foreach (Point point in this.ContactArea.Area)
         {
             if (this.IsRoutewayPossible(point))
             {
                 area.AddPoint(point);
             }
         }
     }
     if (area.Count == 0)
     {
         foreach (Point point in this.LongViewArea.Area)
         {
             if (this.IsRoutewayPossible(point))
             {
                 area.AddPoint(point);
             }
         }
     }
     return area;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:32,代码来源:Architecture.cs


示例13: GetAvailableContactArea

 public GameArea GetAvailableContactArea(bool Square)
 {
     GameArea area = new GameArea();
     foreach (Point point in this.ContactArea.Area)
     {
         if (base.Scenario.IsPositionEmpty(point))
         {
             area.AddPoint(point);
         }
     }
     if (area.Count > 0)
     {
         return area;
     }
     return null;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:16,代码来源:Architecture.cs


示例14: GetAllContactArea

 public GameArea GetAllContactArea()
 {
     GameArea area = new GameArea();
     foreach (Point point in this.ContactArea.Area)
     {
         area.AddPoint(point);
     }
     foreach (Point point in this.ArchitectureArea.Area)
     {
         area.AddPoint(point);
     }
     return area;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:13,代码来源:Architecture.cs


示例15: GetPersonTransferArchitectureArea

        public GameArea GetPersonTransferArchitectureArea()
        {
            GameArea area = new GameArea();

            foreach (Architecture architecture in this.BelongedFaction.Architectures)
            {

                if (architecture == this)
                {
                    continue;
                }

                foreach (Point point in architecture.ArchitectureArea.Area)
                {
                    area.AddPoint(point);
                }

            }
            return area;
        }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:20,代码来源:Architecture.cs


示例16: GetRealTroopEnterableArea

 public GameArea GetRealTroopEnterableArea(Troop troop)
 {
     GameArea area = new GameArea();
     foreach (Point point in this.GetTroopEnterableArea(troop).Area)
     {
         //if (!base.Scenario.PositionIsTroop(point))
         //{
         area.AddPoint(point);
         //}
     }
     return area;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:12,代码来源:Architecture.cs


示例17: GetCampaignPosition

 public Point? GetCampaignPosition(Troop troop, List<Point> orientations, bool close)
 {
     GameArea allAvailableArea = this.GetAllAvailableArea(false);
     GameArea sourceArea = new GameArea();
     foreach (Point point in allAvailableArea.Area)
     {
         if ((base.Scenario.GetArchitectureByPosition(point) == this || troop.IsMovableOnPosition(point)) && base.Scenario.GetTroopByPosition(point) == null)
         {
             sourceArea.Area.Add(point);
         }
     }
     GameArea highestFightingForceArea = troop.GetHighestFightingForceArea(sourceArea);
     if (highestFightingForceArea != null)
     {
         if (close)
         {
             return base.Scenario.GetClosestPosition(highestFightingForceArea, orientations);
         }
         return base.Scenario.GetFarthestPosition(highestFightingForceArea, orientations);
     }
     return null;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:22,代码来源:Architecture.cs


示例18: GetSpyArchitectureArea

 public GameArea GetSpyArchitectureArea()
 {
     GameArea area = new GameArea();
     foreach (Architecture architecture in base.Scenario.Architectures)
     {
         if ((architecture.BelongedFaction != null) && (architecture.BelongedFaction != this.BelongedFaction))
         {
             foreach (Point point in architecture.ArchitectureArea.Area)
             {
                 area.AddPoint(point);
             }
         }
     }
     return area;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:15,代码来源:Architecture.cs


示例19: 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;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:32,代码来源:Architecture.cs


示例20: HasHostileTroopsInView

 public bool HasHostileTroopsInView()
 {
     GameArea viewArea = this.ViewArea;
     if ((this.RecentlyAttacked > 0) || (this.ArmyScale > this.NormalArmyScale))
     {
         viewArea = this.LongViewArea;
     }
     foreach (Point point in viewArea.Area)
     {
         Troop troopByPosition = base.Scenario.GetTroopByPosition(point);
         if ((troopByPosition != null) && (!troopByPosition.IsFriendly(this.BelongedFaction) && (troopByPosition.Status != TroopStatus.埋伏)))
         {
             return true;
         }
     }
     return false;
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:17,代码来源:Architecture.cs



注:本文中的GameObjects.GameArea类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GameObjects.GameDate类代码示例发布时间:2022-05-26
下一篇:
C# GameObjects.Faction类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap