/// <summary> /// A round has finished. /// </summary> /// <param name="round">The finished round.</param> private void OnRoundFinished(Round round) { Contract.Requires(round != null && (Active || Finished)); if (RoundFinished != null) RoundFinished(this); round.RoundFinished -= this.OnRoundFinished; round.NewPile -= this.OnRoundNewPile; }
/// <summary> /// A new pile has been created. /// </summary> /// <param name="round">The round with the new pile.</param> private void OnRoundNewPile(Round round) { if (RoundNewPile != null) RoundNewPile(this); }
/// <summary> /// A new round has begun. /// </summary> /// <param name="round">The new round.</param> private void OnRoundBegun(Round round) { Contract.Requires(round != null && Active); if (RoundBegun != null) RoundBegun(this); round.RoundBegun -= this.OnRoundBegun; }
public static IList<string> ConstructPlayerTricks(Round round) { Contract.Requires(round != null); Contract.Ensures(Contract.Result<IList<string>>() != null); return round.PlayerTricks.Select(kvp => ConstructPlayerTrick(round, kvp.Key)).ToList(); }
public static string ConstructPlayerTrick(Round round, Player player) { Contract.Requires(round != null && player != null && round.PlayerTricks.ContainsKey(player)); Contract.Ensures(Contract.Result<string>() != null); return "player_tricks: " + player.Name + ";" + round.PlayerTricks[player].Count; }
public IList<string> ConstructPlayerTricks(Round round) { IList<string> result = PirateMessage.ConstructPlayerTricks(round); return result; // TODO: add assertions to method PirateMessageTest.ConstructPlayerTricks(Round) }
public string ConstructPlayerTrick(Round round, Player player) { string result = PirateMessage.ConstructPlayerTrick(round, player); return result; // TODO: add assertions to method PirateMessageTest.ConstructPlayerTrick(Round, Player) }