private void InitializeMonsters() { _monsterIcons = new CharacterIcon[] { characterIcon1, characterIcon2, characterIcon3, characterIcon4, characterIcon5 }.ToList(); _monsters = new AddList <Character>(); Character monster1 = new Murloc(); Character monster2 = new Goblin(); Character monster3 = new DarkElf(); Character monster4 = new HighSeer(); Character monster5 = new DarkenstoneDragon(); _monsters.Add(monster1); _monsters.Add(monster2); _monsters.Add(monster3); _monsters.Add(monster4); _monsters.Add(monster5); for (int i = 0; i < 5; i++) { _monsterIcons[i].Character = _monsters[i]; } foreach (CharacterIcon monsterIcon in _monsterIcons) { monsterIcon.OnSelection += new EventHandler(MonsterIconSelected); monsterIcon.OnDeselection += new EventHandler(MonsterIconDeselected); } }
private void InitializePlayers() { _playerIcons = new CharacterIcon[] { playerIcon1, playerIcon2, playerIcon3, playerIcon4, playerIcon5 }.ToList(); _players = new AddList <Player>(); _players.OnAdd += new EventHandler(playerAdded); _players.OnRemove += new EventHandler(playerRemoved); foreach (CharacterIcon playerIcon in _playerIcons) { playerIcon.OnSelection += new EventHandler(PlayerIconSelected); playerIcon.OnDeselection += new EventHandler(PlayerIconDeselected); } }