private void calculatePartyXPDifficultyLevels(PartyClass selectedParty) { partyEasyThreshold = 0; partyMediumThreshold = 0; partyHardThreshold = 0; partyDeadlyThreshold = 0; foreach (PlayerClass currentPlayer in selectedParty.getPartyMembers()) { string Query = "SELECT * from ExperienceThresholds WHERE Id_Level = '" + currentPlayer.getPlayerLevel() + "'"; using (SqlConnection con = new SqlConnection(connectionString)) { using (SqlDataAdapter adaptor = new SqlDataAdapter(Query, con)) { DataTable experienceTable = new DataTable(); adaptor.Fill(experienceTable); foreach (DataRow ExperienceRow in experienceTable.Rows) { partyEasyThreshold += (int)ExperienceRow["Easy"]; partyMediumThreshold += (int)ExperienceRow["Medium"]; partyHardThreshold += (int)ExperienceRow["Hard"]; partyDeadlyThreshold += (int)ExperienceRow["Deadly"]; } con.Close(); } } } }
private void startEncounter(object sender, EventArgs e) { List <Object> toFight = new List <Object>(); foreach (var item in selectedMonsters.Items) { toFight.Add(item); } InitiativeCreation eventMade = new InitiativeCreation(toFight, campaignParty.getPartyMembers()); eventMade.Visible = true; }