Esempio n. 1
0
        public void Setup()
        {
            _WarbandRoster      = new WarBandRoster(new WitchHuntersWarband());
            _WarbandRoster.Name = "MordheimDalTests";

            //Logic requires to add a new warrior
            _WitchHunterCaptain = _WarbandRoster.AddWarrior(new WitchHunterCaptain()) as IHero;

            _WitchHunterCaptain.AddEquipment(new Sword().Name);
            _WitchHunterCaptain.AddEquipment(new CrossBow().Name);
            _WitchHunterCaptain.AddEquipment(new Shield().Name);
            _WitchHunterCaptain.AddEquipment(new LightArmour().Name);

            _WitchHunterCaptain.AddSkill(new MightyBlow());
            _WitchHunterCaptain.AddSkill(new PitFighter());

            _ZealotGroup1 = _WarbandRoster.AddWarrior(new Zealot()) as IHenchMen;
            _ZealotGroup1.AddEquipment(new Sword());
            _ZealotGroup1.AddEquipment(new Sword());
            _ZealotGroup1.IncreaseGroupByOne();
            _ZealotGroup1.IncreaseGroupByOne();

            _ZealotGroup2 = _WarbandRoster.AddWarrior(new Zealot()) as IHenchMen;
            _ZealotGroup2.AddEquipment(new Bow());
            _ZealotGroup2.IncreaseGroupByOne();
            _ZealotGroup2.IncreaseGroupByOne();
            _ZealotGroup2.IncreaseGroupByOne();

            _WarriorPriest = _WarbandRoster.AddWarrior(new WarriorPriest()) as WarriorPriest;
            _WarriorPriest.AddSpell(new HeartsOfSteel());
            _WarriorPriest.AddSpell(new TheHammerOfSigmar());
        }
Esempio n. 2
0
        public static IWarrior FromXml(this IWarbandRoster warbandRoster, XmlWarrior xmlWarrior)
        {
            IWarrior warrior = warbandRoster.WarBand.GetWarrior(xmlWarrior.TypeOfWarrior);

            warrior = warbandRoster.AddWarrior(warrior);
            foreach (string item in xmlWarrior.EquipmentList)
            {
                warrior.AddEquipment(item);
            }
            if (warrior is IHenchMen)
            {
                IHenchMen henchMan = warrior as IHenchMen;

                for (int i = 1; i < xmlWarrior.AmountInGroup; i++)
                {
                    henchMan.IncreaseGroupByOne();
                }
            }
            else if (warrior is IHero)
            {
                IHero hero = warrior as IHero;

                foreach (string skill in xmlWarrior.SkillList)
                {
                    hero.AddSkill(skill);
                }
            }
            if (warrior is IWizard)
            {
                IWizard wizard = warrior as IWizard;

                foreach (string item in xmlWarrior.SpellList)
                {
                    wizard.AddSpell(item);
                }
            }

            return(warrior);
        }