コード例 #1
0
ファイル: Game.cs プロジェクト: webrokeit/PirateSpades
 /// <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;
 }
コード例 #2
0
ファイル: Game.cs プロジェクト: webrokeit/PirateSpades
 /// <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);
 }
コード例 #3
0
ファイル: Game.cs プロジェクト: webrokeit/PirateSpades
 /// <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;
 }
コード例 #4
0
 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();
 }
コード例 #5
0
 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;
 }
コード例 #6
0
 public IList<string> ConstructPlayerTricks(Round round)
 {
     IList<string> result = PirateMessage.ConstructPlayerTricks(round);
     return result;
     // TODO: add assertions to method PirateMessageTest.ConstructPlayerTricks(Round)
 }
コード例 #7
0
 public string ConstructPlayerTrick(Round round, Player player)
 {
     string result = PirateMessage.ConstructPlayerTrick(round, player);
     return result;
     // TODO: add assertions to method PirateMessageTest.ConstructPlayerTrick(Round, Player)
 }