Example #1
0
        public override UIStep NextStep(int option)
        {
            UIStep nextStep = this;

            switch (option)
            {
            case 1:
                List <Type> types      = new List <Type>(ModHandler.GetAllUnits());
                int         typesCount = types.Count;

                Console.WriteLine("Choose type:");
                ConsoleUI.PrintNumericList(1, types.Select(x => x.Name));
                int typeNumber = ConsoleUI.GetNumericOption(1, typesCount);

                Console.Write("Choose count: ");
                int count = ConsoleUI.GetNumericOption(0, int.Parse(Config.GetValue("UnitsStack:MAXSIZE")));

                Unit instance = (Unit)(types[typeNumber - 1]).GetProperty("Instance").GetValue(null, null);
                firstPlayer.army.AddStack(new UnitsStack(instance, (uint)count));

                break;

            case 2:
                ConsoleUI.PrintNumericList(1, firstPlayer.army.unitsStackList.Select(x => x.ToString()));
                Console.Write("Choose nubmer: ");
                int stackNumber = ConsoleUI.GetNumericOption(1, firstPlayer.army.unitsStackList.Count);

                firstPlayer.army.RemoveStack(firstPlayer.army.unitsStackList[stackNumber - 1]);
                break;

            case 3:
                nextStep = new SecondPlayerInterface(firstPlayer, secondPlayer, this);
                break;

            case 4:
                firstPlayer.army.Clear();
                break;

            case 5:
                nextStep = prevStep;
                break;
            }
            return(nextStep);
        }
Example #2
0
        public override UIStep NextStep(int option)
        {
            UIStep nextStep = null;

            switch (option)
            {
            // 1 - "Attack", 2 - "Cast", 3 - "Wait", 4 - "Defend", 5 - "Surrender", 6 - "Help", 7 - Show stats
            case 1:
                nextStep = new AttackInterface(battle, stack);
                break;

            case 2:
                nextStep = new CastInterface(battle, stack);
                break;

            case 3:
                Action.Wait(stack);
                nextStep = this;
                break;

            case 4:
                Action.Defend(stack);
                nextStep = this;
                break;

            case 5:
                nextStep = new EndGameInterface(battle, stack);
                break;

            case 6:
                nextStep = new HelpInterface(this);
                break;

            case 7:
                nextStep = new UnitStatsInterface(stack.unitsType, this);
                break;

            default:
                nextStep = new EndGameInterface(battle);
                break;
            }
            return(nextStep);
        }
Example #3
0
        public override UIStep NextStep(int option)
        {
            UIStep nextStep = null;

            switch (option)
            {
            case 1:
                nextStep = new CommonMechanicsInterface(this);
                break;

            case 2:
                nextStep = new UnitsHelpInterface(this);
                break;

            case 3:
                nextStep = new InitiativeHelpInterface(this);
                break;

            case 4:
                nextStep = new CastHelpInterface(this);
                break;

            case 5:
                nextStep = new ModifiersHelpInterface(this);
                break;

            case 6:
                nextStep = new EffectHelpInterface(this);
                break;

            case 7:
                nextStep = prevStep;
                break;

            default:
                nextStep = this;
                break;
            }
            return(nextStep);
        }
Example #4
0
 public CastStatsInterface(ICast _cast, UIStep _prevStep)
 {
     prevStep = _prevStep;
     cast     = _cast;
 }
Example #5
0
 public EffectHelpInterface(UIStep _prevStep)
 {
     prevStep   = _prevStep;
     types      = new List <Type>(ModHandler.GetAllEffects());
     typesCount = types.Count;
 }
Example #6
0
 public FirstPlayerArmyInterface(Player _firstPlayer, Player _secondPlayer, UIStep _prevStep)
 {
     firstPlayer  = _firstPlayer;
     secondPlayer = _secondPlayer;
     prevStep     = _prevStep;
 }
Example #7
0
 public InitiativeHelpInterface(UIStep _prevStep)
 {
     prevStep = _prevStep;
 }
Example #8
0
 public EffectStatsInterface(BaseEffect _effect, UIStep _prevStep)
 {
     prevStep = _prevStep;
     effect   = _effect;
 }
Example #9
0
 public HelpInterface(UIStep _prevStep)
 {
     prevStep = _prevStep;
 }
 public ModifierStatsInterface(IModifier _modifier, UIStep _prevStep)
 {
     prevStep = _prevStep;
     modifier = _modifier;
 }
Example #11
0
 public UnitStatsInterface(Unit _unit, UIStep _prevStep)
 {
     prevStep = _prevStep;
     unit     = _unit;
 }
 public CommonMechanicsInterface(UIStep _prevStep)
 {
     prevStep = _prevStep;
 }
Example #13
0
 public ModifiersHelpInterface(UIStep _prevStep)
 {
     prevStep   = _prevStep;
     types      = new List <Type>(ModHandler.GetAllModifiers());
     typesCount = types.Count;
 }