当前位置: 首页>>代码示例>>C#>>正文


C# GameObjects.GameScenario类代码示例

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


GameScenario类属于GameObjects命名空间,在下文中一共展示了GameScenario类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

 public static Military Create(GameScenario scenario, Architecture architecture, MilitaryKind kind)
 {
     Military military = new Military();
     military.Scenario = scenario;
     military.KindID = kind.ID;
     military.ID = scenario.Militaries.GetFreeGameObjectID();
     if (kind.RecruitLimit == 1)
     {
         military.Name = kind.Name;
     }
     else
     {
         military.Name = kind.Name + "队";
     }
     architecture.AddMilitary(military);
     architecture.BelongedFaction.AddMilitary(military);
     scenario.Militaries.AddMilitary(military);
     architecture.DecreaseFund((int) (kind.CreateCost * kind.GetRateOfNewMilitary(architecture)));
     if (kind.IsTransport)
     {
         military.Quantity = kind.MaxScale;
         military.Morale = military.MoraleCeiling;
         military.Combativity = military.CombativityCeiling;
     }
     return military;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:26,代码来源:Military.cs

示例2: AddBasicMilitaryKinds

 public void AddBasicMilitaryKinds(GameScenario scen)
 {
     this.AddMilitaryKind(scen.GameCommonData.AllMilitaryKinds.GetMilitaryKindList().GetGameObject(0) as MilitaryKind);
     this.AddMilitaryKind(scen.GameCommonData.AllMilitaryKinds.GetMilitaryKindList().GetGameObject(1) as MilitaryKind);
     this.AddMilitaryKind(scen.GameCommonData.AllMilitaryKinds.GetMilitaryKindList().GetGameObject(2) as MilitaryKind);
     this.AddMilitaryKind(scen.GameCommonData.AllMilitaryKinds.GetMilitaryKindList().GetGameObject(30) as MilitaryKind);
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:MilitaryKindTable.cs

示例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.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

示例4: DiplomaticRelation

 public DiplomaticRelation(GameScenario scenario, int faction1ID, int faction2ID, int relation)
 {
     this.relationFaction1ID = -1;
     this.relationFaction2ID = -1;
     base.Scenario = scenario;
     this.RelationFaction1ID = faction1ID;
     this.RelationFaction2ID = faction2ID;
     this.Relation = relation;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:9,代码来源:DiplomaticRelation.cs

示例5: AddDiplomaticRelation

 public bool AddDiplomaticRelation(GameScenario scenario, int faction1ID, int faction2ID, int relation)
 {
     int hashCode = this.GetHashCode(faction1ID, faction2ID);
     int key = this.GetHashCode(faction2ID, faction1ID);
     if (this.DiplomaticRelations.ContainsKey(hashCode) || this.DiplomaticRelations.ContainsKey(key))
     {
         return false;
     }
     this.DiplomaticRelations.Add(hashCode, new DiplomaticRelation(scenario, faction1ID, faction2ID, relation));
     return true;
 }
开发者ID:hero1991,项目名称:ZhongHuaSanGuoZhi,代码行数:11,代码来源:DiplomaticRelationTable.cs

示例6: RemoveMilitaryKind

 public bool RemoveMilitaryKind(GameScenario scenario, int kind)
 {
     if (!this.MilitaryKinds.ContainsKey(kind))
     {
         return false;
     }
     MilitaryKind militaryKind = scenario.GameCommonData.AllMilitaryKinds.GetMilitaryKind(kind);
     if (militaryKind != null)
     {
         this.MilitaryKinds.Remove(militaryKind.ID);
     }
     return true;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:13,代码来源:MilitaryKindTable.cs

示例7: 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

示例8: GetDiplomaticRelation

 public DiplomaticRelation GetDiplomaticRelation(GameScenario scenario, int faction1ID, int faction2ID)
 {
     int hashCode = this.GetHashCode(faction1ID, faction2ID);
     DiplomaticRelation relation = null;
     this.DiplomaticRelations.TryGetValue(hashCode, out relation);
     if (relation == null)
     {
         hashCode = this.GetHashCode(faction2ID, faction1ID);
         this.DiplomaticRelations.TryGetValue(hashCode, out relation);
     }
     if (relation == null)
     {
         relation = new DiplomaticRelation(scenario, faction1ID, faction2ID, 0);
     }
     return relation;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:16,代码来源:DiplomaticRelationTable.cs

示例9: Create

 public static Captive Create(GameScenario scenario, Person person, Faction capturingFaction)
 {
     if (person.BelongedFaction == null)
     {
         return null;
     }
     if (person.BelongedFaction == capturingFaction)
     {
         return null;
     }
     Captive captive = new Captive();
     captive.Scenario = scenario;
     captive.ID = scenario.Captives.GetFreeGameObjectID();
     captive.CaptivePerson = person;
     captive.CaptiveFaction = person.BelongedFaction;
     person.SetBelongedCaptive(captive, GameObjects.PersonDetail.PersonStatus.Captive);
     person.HeldCaptiveCount++;
     scenario.Captives.AddCaptiveWithEvent(captive);
     return captive;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:20,代码来源:Captive.cs

示例10: ChallgenEvent

        private bool ChallengeOftenShow = false;  //暴击必然触发单挑,调试单挑程序用,默认为false


        internal void ChallgenEvent(Troop sourceTroop, Troop troop, TroopDamage damage, GameScenario gameScenario)
        {
            if ((!sourceTroop.IsFriendly(troop.BelongedFaction) && !sourceTroop.AirOffence) && (this.ChallengeOftenShow || GameObject.Chance(20)))
            {
                Person maxStrengthPerson = sourceTroop.Persons.GetMaxStrengthPerson();
                Person destination = troop.Persons.GetMaxStrengthPerson();
                if (((maxStrengthPerson != null) && (destination != null)) && (this.ChallengeOftenShow || (GameObject.Random(GameObject.Square(destination.Calmness)) < GameObject.Random(0x19))))
                {
                    if (maxStrengthPerson.IsCivil() || destination.IsCivil())  //文官不单挑
                    {
                        return;
                    }
                    int chance = Person.ChanlengeWinningChance(maxStrengthPerson, destination);
                    if (this.ChallengeOftenShow || (maxStrengthPerson.Character.ChallengeChance + chance) >= 60)
                    {
                        this.challengeHappen(damage, maxStrengthPerson, destination, chance, gameScenario);
                    }
                }
            }
        }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:23,代码来源:Challenge.cs

示例11: Create

 public static Captive Create(GameScenario scenario, Person person, Faction faction)
 {
     if (person.BelongedFaction == null)
     {
         return null;
     }
     if (person.BelongedFaction == faction)
     {
         return null;
     }
     Captive captive = new Captive();
     captive.Scenario = scenario;
     captive.ID = scenario.Captives.GetFreeGameObjectID();
     captive.CaptivePerson = person;
     person.BelongedCaptive = captive;
     captive.CaptiveFaction = person.BelongedFaction;
     scenario.Captives.AddCaptiveWithEvent(captive);
     captive.CaptiveFaction.AddSelfCaptive(captive);
     faction.AddCaptive(captive);
     return captive;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:21,代码来源:Captive.cs

示例12: challengeHappen

        private void challengeHappen(TroopDamage damage, Person maxStrengthPerson, Person destination, int chance,GameScenario scenario)
        {
            int flag = 0;
            damage.ChallengeHappened = true;  //单挑发生
            if ((GlobalVariables.ShowChallengeAnimation) &&
                (scenario.IsPlayer(maxStrengthPerson.BelongedFaction) || scenario.IsPlayer(destination.BelongedFaction) || GlobalVariables.SkyEye || this.ChallengeOftenShow))  //单挑双方有玩家的武将才演示
            {
                try
                {
                    int returnValue;
                    returnValue = this.challengeShow(maxStrengthPerson, destination);
                    //returnValue = 10;
                    if (returnValue >= -4 && returnValue <= 10 && returnValue != 0)
                    {
                        flag = returnValue;
                    }
                    else   //返回值出错时避免跳出
                    {
                        flag = (GameObject.Chance(chance) ? 1 : 2);
                    }

                }
                catch
                {
                    flag = (GameObject.Chance(chance) ? 1 : 2);
                }
            }
            else
            {
                flag = (GameObject.Chance(chance) ? 1 : 2);
            }

            //flag = -4;

            damage.ChallengeResult = flag;
            damage.ChallengeSourcePerson = maxStrengthPerson;
            damage.ChallengeDestinationPerson = destination;

        }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:39,代码来源:Challenge.cs

示例13: SimCreate

 public static Military SimCreate(GameScenario scenario, Architecture architecture, MilitaryKind kind)
 {
     Military military = new Military();
     military.Scenario = scenario;
     military.KindID = kind.ID;
     military.ID = scenario.Militaries.GetFreeGameObjectID();
     if (kind.RecruitLimit == 1)
     {
         military.Name = kind.Name;
         return military;
     }
     military.Name = kind.Name + "队";
     return military;
 }
开发者ID:kpxp,项目名称:ZhongHuaSanGuoZhi-New-Code,代码行数:14,代码来源:Military.cs

示例14: Initialize

 public void Initialize(GameScenario scenario)
 {
     this.gameScenario = scenario;
 }
开发者ID:kpxp,项目名称:ZhongHuaSanGuoZhi-New-Code,代码行数:4,代码来源:ScreenManager.cs

示例15: LoadPersonGeneratorSetting

        public List<string> LoadPersonGeneratorSetting(OleDbConnection connection, GameScenario scen)
        {
            connection.Open();
            OleDbDataReader reader = new OleDbCommand("Select * From PersonGenerator", connection).ExecuteReader();
            while (reader.Read())
            {
                this.PersonGeneratorSetting.bornLo = (int)reader["BornLo"];
                this.PersonGeneratorSetting.bornHi = (int)reader["BornHi"];
                this.PersonGeneratorSetting.debutLo = (int)reader["DebutLo"];
                this.PersonGeneratorSetting.debutHi = (int)reader["DebutHi"];
                this.PersonGeneratorSetting.dieLo = (int)reader["DieLo"];
                this.PersonGeneratorSetting.dieHi = (int)reader["DieHi"];
                this.PersonGeneratorSetting.femaleChance = (int)reader["FemaleChance"];
                this.PersonGeneratorSetting.debutAtLeast = (int)reader["DebutAtLeast"];
            }
            connection.Close();

            return new List<string>();
        }
开发者ID:hero1991,项目名称:ZhongHuaSanGuoZhi,代码行数:19,代码来源:CommonData.cs


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