private void parseOpponent() { String[] tmp = msg[0].Split(':'); while (!(tmp[0].Equals("end") && tmp[1].Equals("opponent"))) { tmp = msg[0].Split(':'); if (tmp[0].Equals("id")) { this.id = Int32.Parse(tmp[1]); msg.RemoveAt(0); tmp = msg[0].Split(':'); if (tmp[0].Equals("decision")) { this.decision = tmp[1]; msg.RemoveAt(0); tmp = msg[0].Split(':'); if (tmp[0].Equals("points")) { this.points = Int32.Parse(tmp[1]); msg.RemoveAt(0); tmp = msg[0].Split(':'); if (tmp[0].Equals("total")) { this.total = Int32.Parse(tmp[1]); msg.RemoveAt(0); tmp = msg[0].Split(':'); if (tmp[0].Equals("end") && tmp[1].Equals("opponent")) { Opponent o = new Opponent(id, decision, points, total); clearVars(); } else { throw new Exception("NO OPPONENT"); } } } } } else { throw new Exception("NO OPPONENT"); } } }
public Skirmish(Opponent opponent, Boolean isAccepted) : base(opponent, isAccepted, "Skirmish") { }
public Dragonhunt(Int32 id, Player player, Opponent opponent, Boolean isAccepted) : base(opponent, isAccepted, "Dragonhunt") { }
//instead Opponent just int id ?? public Challenge(Opponent opponent, Boolean isAccepted, String type) { this.opponentId = opponent; this.isAccepted = isAccepted; this.type = type; }
public Staghunt(Opponent opponent, Boolean isAccepted) : base(opponent, isAccepted, "Staghunt") { }