/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns> public override int GetHashCode() { unchecked { var hashCode = (Game != null ? Game.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Rounds != null ? Rounds.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (LastRound != null ? LastRound.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Team1WinsCount; hashCode = (hashCode * 397) ^ Team2WinsCount; hashCode = (hashCode * 397) ^ DrawsCount; return(hashCode); } }
/// <summary> /// Plays given round, calculating everything, moving this instance of /// the game into position after the round was played. /// </summary> public virtual void PlayRound() { var linearizedRound = LastRound.Linearize(); roundHandler.PlayRound(linearizedRound); Game.Refresh(); AllRounds.Add(linearizedRound); // if I played a round it means that next round will surelly wont be GameBeginningRound LastRound = new GameRound(); OnRoundPlayed?.Invoke(); }