/// <summary> /// Fills out Horde team with coords and skins /// Distributes all members in fields to either alliance or horde team ("purple or blue team respectively") /// Starts up the Arena Window /// </summary> public void StartBattle() { List <ArenaFieldPoint_DTO> tmpFPList = new List <ArenaFieldPoint_DTO>(); tmpFPList = GenerateCoordsList("actualArena"); if (tmpFPList.Count != 0) //to make sure we don't go to next window. { string enemyTeam = tImpl.GetEnemyTeamName(); int coordCounter = 0; //used to give each player a set of coords skinCounter = 0; foreach (var item in tImpl.GetEnemyTeam(enemyTeam)) { item.PointGS = tmpFPList[coordCounter]; item.ImageGS = pImpl.GetHordeskin(skinCounter);// Storage.HordeSkins[skinCounter]; ArenaImpl.AddParticipantToField(item); skinCounter++; coordCounter++; } //test for team name and then color respectively, also here, find random enemy team. List <ArenaFieldPoint_DTO> tmp = ArenaImpl.GetField(); //DEBUGGING foreach (ArenaFieldPoint_DTO AFP_DTO in ArenaImpl.GetField()) { if (AFP_DTO.PDTO != null) { if (AFP_DTO.PDTO.TeamGS.Equals(TeamListBox.SelectedValue.ToString())) { AFP_DTO.PDTO.TeamColorGS = AllianceTeamColor; Arena_DTO.AllianceTeam.Add(AFP_DTO.PDTO); } else { AFP_DTO.PDTO.TeamColorGS = HordeTeamColor; AFP_DTO.PDTO.PointGS.FieldPointStatusGS = FieldStatus_DTO.FieldStatus.HordeOccupied; Arena_DTO.HordeTeam.Add(AFP_DTO.PDTO); } } } ArenaWindow fw = new ArenaWindow(this, ArenaImpl, pImpl); fw.Closed += new EventHandler(Reference); fw.WindowStartupLocation = WindowStartupLocation.CenterScreen; fw.Show(); this.Hide(); } }
/// <summary> /// Gets list of active players (only used at the beginning of the fight) /// </summary> /// <returns></returns> public List <Fighter_DTO> GetActivePlayers() { List <Fighter_DTO> ActivePlayers = new List <Fighter_DTO>(); foreach (ArenaFieldPoint_DTO AFP_DTO in arenaImpl.GetField()) { if (AFP_DTO.PDTO != null) { ActivePlayers.Add(AFP_DTO.PDTO); } } return(ActivePlayers); }