public CustomBattleMenuVM(CustomBattleState battleState)
 {
     this._customBattleState = battleState;
     this.IsAttackerCustomMachineSelectionEnabled = false;
     this.PlayerSide = new CustomBattleMenuSideVM(new TextObject("{=BC7n6qxk}PLAYER"), true);
     this.EnemySide  = new CustomBattleMenuSideVM(new TextObject("{=35IHscBa}ENEMY"), false);
     this.PlayerSide.OppositeSide = this.EnemySide;
     this.EnemySide.OppositeSide  = this.PlayerSide;
     this.MapSelectionGroup       = new MapSelectionGroupVM();
     this.GameTypeSelectionGroup  = new GameTypeSelectionGroupVM(new Action <CustomBattlePlayerType>(this.OnPlayerTypeChange), new Action <CustomBattleGameType>(this.OnGameTypeChange));
     this.AttackerMeleeMachines   = new MBBindingList <CustomBattleSiegeMachineVM>();
     for (int index = 0; index < 3; ++index)
     {
         this.AttackerMeleeMachines.Add(new CustomBattleSiegeMachineVM((SiegeEngineType)null, new Action <CustomBattleSiegeMachineVM>(this.OnMeleeMachineSelection)));
     }
     this.AttackerRangedMachines = new MBBindingList <CustomBattleSiegeMachineVM>();
     for (int index = 0; index < 4; ++index)
     {
         this.AttackerRangedMachines.Add(new CustomBattleSiegeMachineVM((SiegeEngineType)null, new Action <CustomBattleSiegeMachineVM>(this.OnAttackerRangedMachineSelection)));
     }
     this.DefenderMachines = new MBBindingList <CustomBattleSiegeMachineVM>();
     for (int index = 0; index < 4; ++index)
     {
         this.DefenderMachines.Add(new CustomBattleSiegeMachineVM((SiegeEngineType)null, new Action <CustomBattleSiegeMachineVM>(this.OnDefenderRangedMachineSelection)));
     }
     this.RefreshValues();
     this.SetDefaultSiegeMachines();
 }
Exemple #2
0
        public CustomBattleMenuVM(CustomBattleState battleState)
        {
            ////this.\u002Ector();
            this._customBattleState = battleState;
            List <BasicCultureObject> basicCultureObjectList = new List <BasicCultureObject>();

            basicCultureObjectList.Add((BasicCultureObject)Game.Current.ObjectManager.GetObject <BasicCultureObject>("empire"));
            basicCultureObjectList.Add((BasicCultureObject)Game.Current.ObjectManager.GetObject <BasicCultureObject>("sturgia"));
            basicCultureObjectList.Add((BasicCultureObject)Game.Current.ObjectManager.GetObject <BasicCultureObject>("aserai"));
            basicCultureObjectList.Add((BasicCultureObject)Game.Current.ObjectManager.GetObject <BasicCultureObject>("vlandia"));
            basicCultureObjectList.Add((BasicCultureObject)Game.Current.ObjectManager.GetObject <BasicCultureObject>("battania"));
            basicCultureObjectList.Add((BasicCultureObject)Game.Current.ObjectManager.GetObject <BasicCultureObject>("khuzait"));
            this._factionList        = basicCultureObjectList;
            this._customBattleScenes = new List <CustomBattleSceneData>();
            List <BasicCharacterObject> basicCharacterObjectList = new List <BasicCharacterObject>();

            basicCharacterObjectList.Add((BasicCharacterObject)Game.Current.ObjectManager.GetObject <BasicCharacterObject>("commander_1"));
            basicCharacterObjectList.Add((BasicCharacterObject)Game.Current.ObjectManager.GetObject <BasicCharacterObject>("commander_2"));
            basicCharacterObjectList.Add((BasicCharacterObject)Game.Current.ObjectManager.GetObject <BasicCharacterObject>("commander_3"));
            basicCharacterObjectList.Add((BasicCharacterObject)Game.Current.ObjectManager.GetObject <BasicCharacterObject>("commander_4"));
            basicCharacterObjectList.Add((BasicCharacterObject)Game.Current.ObjectManager.GetObject <BasicCharacterObject>("commander_5"));
            basicCharacterObjectList.Add((BasicCharacterObject)Game.Current.ObjectManager.GetObject <BasicCharacterObject>("commander_6"));
            basicCharacterObjectList.Add((BasicCharacterObject)Game.Current.ObjectManager.GetObject <BasicCharacterObject>("commander_7"));
            this._charactersList = basicCharacterObjectList;
            this.EnemySide       = new CustomBattleMenuSideVM(new TextObject("{=35IHscBa}ENEMY", (Dictionary <string, TextObject>)null), false);
            this.PlayerSide      = new CustomBattleMenuSideVM(new TextObject("{=BC7n6qxk}PLAYER", (Dictionary <string, TextObject>)null), true);
            List <string> stringList = new List <string>();
            List <string> list       = ((IEnumerable <BasicCultureObject>) this._factionList).Select <BasicCultureObject, string>((Func <BasicCultureObject, string>)(f => ((object)f.Name).ToString())).ToList <string>();

            this.EnemySide.FactionSelectionGroup.Refresh((IEnumerable <string>)list, 0, new Action <SelectorVM <SelectorItemVM> >(this.OnEnemyFactionSelection));
            this.PlayerSide.FactionSelectionGroup.Refresh((IEnumerable <string>)list, 0, new Action <SelectorVM <SelectorItemVM> >(this.OnPlayerFactionSelection));
            this.IsAttackerCustomMachineSelectionEnabled = false;
            List <MapSelectionElement> elementList = new List <MapSelectionElement>();

            this._customBattleScenes = CustomGame.Current.CustomBattleScenes.ToList <CustomBattleSceneData>();
            using (List <CustomBattleSceneData> .Enumerator enumerator = this._customBattleScenes.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    CustomBattleSceneData current = enumerator.Current;
                    elementList.Add(new MapSelectionElement((current.Name).ToString(), ((CustomBattleSceneData)current).IsSiegeMap, ((CustomBattleSceneData)current).IsVillageMap));
                }
            }
            this.MapSelectionGroup = new MapSelectionGroup(((object)new TextObject("{=fXhblsky}MAP", (Dictionary <string, TextObject>)null)).ToString(), elementList);
            this.PlayerSide.CharacterSelectionGroup.Refresh((IEnumerable <string>)((IEnumerable <BasicCharacterObject>) this._charactersList).Select <BasicCharacterObject, string>((Func <BasicCharacterObject, string>)(p => ((object)p.Name).ToString())).ToList <string>(), 0, new Action <SelectorVM <SelectorItemVM> >(this.OnPlayerCharacterSelection));
            this.EnemySide.CharacterSelectionGroup.Refresh((IEnumerable <string>)((IEnumerable <BasicCharacterObject>) this._charactersList).Select <BasicCharacterObject, string>((Func <BasicCharacterObject, string>)(p => ((object)p.Name).ToString())).ToList <string>(), 1, new Action <SelectorVM <SelectorItemVM> >(this.OnEnemyCharacterSelection));
            this.OnPlayerCharacterSelection(this.PlayerSide.CharacterSelectionGroup);
            this.OnEnemyCharacterSelection(this.EnemySide.CharacterSelectionGroup);
            this.AttackerMeleeMachines = new MBBindingList <CustomBattleSiegeMachineVM>();
            for (int index = 0; index < 3; ++index)
            {
                ((Collection <CustomBattleSiegeMachineVM>) this.AttackerMeleeMachines).Add(new CustomBattleSiegeMachineVM((SiegeEngineType)null, new Action <CustomBattleSiegeMachineVM>(this.OnMeleeMachineSelection)));
            }
            this.AttackerRangedMachines = new MBBindingList <CustomBattleSiegeMachineVM>();
            for (int index = 0; index < 4; ++index)
            {
                ((Collection <CustomBattleSiegeMachineVM>) this.AttackerRangedMachines).Add(new CustomBattleSiegeMachineVM((SiegeEngineType)null, new Action <CustomBattleSiegeMachineVM>(this.OnAttackerRangedMachineSelection)));
            }
            this.DefenderMachines = new MBBindingList <CustomBattleSiegeMachineVM>();
            for (int index = 0; index < 4; ++index)
            {
                ((Collection <CustomBattleSiegeMachineVM>) this.DefenderMachines).Add(new CustomBattleSiegeMachineVM((SiegeEngineType)null, new Action <CustomBattleSiegeMachineVM>(this.OnDefenderRangedMachineSelection)));
            }
            this.GameTypeSelectionGroup = new GameTypeSelectionGroup("Game Type", this.MapSelectionGroup, new Action <bool>(this.OnPlayerTypeChange));
            base.RefreshValues();
        }
 public CustomBattleScreen(CustomBattleState customBattleState)
 {
     this._customBattleState = customBattleState;
 }
Exemple #4
0
 public CustomBattleScreen(CustomBattleState customBattleState)
 {
     ////this.\u002Ector();
     this._customBattleState = customBattleState;
 }