private void CreateHero(Player player, int cellsRow, int cellsCol) { heroId += 1; Hero hero = new Heroes.Core.Map.Heros.Knight(); hero._id = heroId; hero._playerId = player._id; hero._player = player; hero._image = player._heroImage; player._heroes.Add(hero); // spells Heroes.Core.Spell spell = new Heroes.Core.Spell(); hero._spells.Add(spell._id, spell); picContainer = new PictureBox(); picContainer.Size = new Size(_mapTerrain.cellWidth, _mapTerrain.cellHeight); picContainer.Location = new Point(_mapTerrain.cellXYss[cellsRow][cellsCol][0], _mapTerrain.cellXYss[cellsRow][cellsCol][1]); picContainer.Image = player._heroHighlight; picContainer.BorderStyle = BorderStyle.None; this.picContainer.MouseClick += new MouseEventHandler(picContainer_MouseClick); this.panelBigMap.Controls.Add(picContainer); }
private void CreateHero(int heroId, Player player, int cellsRow, int cellsCol) { Hero hero = new Heroes.Core.Map.Heros.Knight(); hero._id = heroId; hero._playerId = player._id; hero._player = player; hero._image = player._heroImage; player._heroes.Add(hero); // spells Heroes.Core.Spell spell = new Heroes.Core.Spell(); hero._spells.Add(spell._id, spell); hero._cell = _cells[cellsRow, cellsCol]; hero._cell._hero = hero; { Armies.Pikeman c = new Heroes.Core.Map.Armies.Pikeman(); c._heroId = hero._id; c._playerId = hero._playerId; c.AddAttribute(hero); c._qty = 20; c._slotNo = 0; hero._armyKSlots.Add(c._slotNo, c); } //{ // Armies.Pikeman c = new Heroes.Core.Map.Armies.Pikeman(); // c._heroId = hero._id; // c._playerId = hero._playerId; // c.AddAttribute(hero); // c._qty = 10; // c._slotNo = 1; // hero._armyKSlots.Add(c._slotNo, c); //} //{ // Armies.Archer c = new Heroes.Core.Map.Armies.Archer(); // c._heroId = hero._id; // c._playerId = hero._playerId; // c.AddAttribute(hero); // c._qty = 10; // c._slotNo = 2; // hero._armyKSlots.Add(c._slotNo, c); //} //{ // Armies.Griffin c = new Heroes.Core.Map.Armies.Griffin(); // c._heroId = hero._id; // c._playerId = hero._playerId; // c.AddAttribute(hero); // c._qty = 10; // c._slotNo = 3; // hero._armyKSlots.Add(c._slotNo, c); //} }