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; }
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; }
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; }
//Создает список сущест, который передает классу 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(); }
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; }
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; }
//Этот класс нужно конкретизировать в наследнике для создания юнита public abstract Cell CreateInstance(World world);
public WizardManager(World world) { _coord = new Coordinate(2,1); _world = world; }
public Cat(World world) { _world = world; }
public override Cell CreateInstance(World world) { Enemy enemy = new Enemy(EnemyHealth, EnemyMana, EnemyArmor, EnemyDamage, EnemyLevel, world); enemy.DieEnemy += world.DecreaseEnemy; return enemy; }
public override Cell CreateInstance(World world) { return new Smith(world); }
public override Cell CreateInstance(World world) { return new EmptyCell(); }
public Smith(World world) { _world = world; }