Exemple #1
0
        public static World CreateCell(out WizardManager manager)
        {
            World world = new World();
            manager = new WizardManager(world);

            EmptyCellFactory ecf = new EmptyCellFactory();
            ecf.Finish += world.FillWorld;
            ecf.CreateListUnits(AmountEmptyCell, world);

            WayFactory wayF = new WayFactory();
            wayF.Finish += world.FillWorld;
            wayF.CreateListUnits(AmountWay, world);

            WizardFactory wf = new WizardFactory();
            wf.CreateHero += manager.InitHero;
            wf.Finish += world.FillWorld;
            wf.CreateListUnits(AmountHero, world);

            EnemyFactory ef = new EnemyFactory();
            ef.Finish += world.FillWorld;
            ef.CreateListUnits(AmountEnemy, world);

            SmithFactory sf = new SmithFactory();
            sf.Finish += world.FillWorld;
            sf.CreateListUnits(AmountFriend, world);

            CatFactory cf = new CatFactory();
            cf.Finish += world.FillWorld;
            cf.CreateListUnits(AmountFriend, world);

            return world;
        }
Exemple #2
0
 public Enemy(int health, int mana, int armor, int damage, 
     int level, World world)
 {
     Health = health;
     Mana = mana;
     Armor = armor;
     Damage = damage;
     Level = level;
     _world = world;
 }
Exemple #3
0
        public override Cell CreateInstance(World world)
        {
            HeroEquipment equipment = new HeroEquipment("simple helmet", "simple armor", "simple shoes", CapacityBelt);

            HeroStay hs = new HeroStay(Strong, Agility, Endurance, Intelligence);
            Wizard wizard = new Wizard(hs, world, equipment, Health, Mana, Damage, Armor, LevelFraction);

            OnCreateHero(wizard);
            return wizard;
        }
Exemple #4
0
        //Создает список сущест, который передает классу World для отрисовки
        public void CreateListUnits(int amount, World world)
        {
            _cell = new List<Cell>(amount);

            for (int i = 0; i < amount; ++i)
            {
                _cell.Add(CreateInstance(world));
            }

            OnFinishCreate();
        }
Exemple #5
0
        public Wizard(HeroStay hs, World world, HeroEquipment equipment, int heroHealth, int heroMana, 
                        int heroDamage, int heroArmor, int levelFraction)
        {
            HeroStay = hs;
            _world = world;

            Health = heroHealth;
            Armor = heroArmor;
            Damage = heroDamage;
            Mana = heroMana;
            FractionLevel = levelFraction;
            HeroEquipment = equipment;
            Level = 1;
        }
Exemple #6
0
        public static World CreateCell()
        {
            World world = new World();

            HeroFactory hf = new HeroFactory();
            hf.Finish += world.FillWorld;
            hf.FillStack(1); //числа взяты с потолка

            EnemyFactory ef = new EnemyFactory();
            ef.Finish += world.FillWorld;
            ef.FillStack(20);

            ThingFactory tf = new ThingFactory();
            tf.Finish += world.FillWorld;
            tf.FillStack(20);

            return world;
        }
Exemple #7
0
 //Этот класс нужно конкретизировать в наследнике для создания юнита
 public abstract Cell CreateInstance(World world);
Exemple #8
0
 public WizardManager(World world)
 {
     _coord = new Coordinate(2,1);
     _world = world;
 }
Exemple #9
0
 public Cat(World world)
 {
     _world = world;
 }
Exemple #10
0
 public override Cell CreateInstance(World world)
 {
     Enemy enemy = new Enemy(EnemyHealth, EnemyMana, EnemyArmor, EnemyDamage, EnemyLevel, world);
     enemy.DieEnemy += world.DecreaseEnemy;
     return enemy;
 }
Exemple #11
0
 public override Cell CreateInstance(World world)
 {
     return new Smith(world);
 }
Exemple #12
0
 public override Cell CreateInstance(World world)
 {
     return new EmptyCell();
 }
Exemple #13
0
 public Smith(World world)
 {
     _world = world;
 }