Пример #1
0
        public bool Equals(Player other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(CardStats.OrderBy(cs => cs.Key).SequenceEqual(other.CardStats.OrderBy(cs => cs.Key)) &&
                   ComputerDifficulty == other.ComputerDifficulty &&
                   ComputerPlayerId == other.ComputerPlayerId &&
                   Equals(ExperienceProgress, other.ExperienceProgress) &&
                   Equals(HumanPlayerId, other.HumanPlayerId) &&
                   IsHuman == other.IsHuman &&
                   LeaderId == other.LeaderId &&
                   LeaderPowerStats.OrderBy(lps => lps.Key).SequenceEqual(other.LeaderPowerStats.OrderBy(lps => lps.Key)) &&
                   PlayerCompletedMatch == other.PlayerCompletedMatch &&
                   PlayerMatchOutcome == other.PlayerMatchOutcome &&
                   PointStats.OrderBy(p => p.Key).SequenceEqual(other.PointStats.OrderBy(p => p.Key)) &&
                   Equals(RatingProgress, other.RatingProgress) &&
                   TeamId == other.TeamId &&
                   TeamPlayerIndex == other.TeamPlayerIndex &&
                   TimeInMatch.Equals(other.TimeInMatch) &&
                   UnitStats.OrderBy(us => us.Key).SequenceEqual(other.UnitStats.OrderBy(us => us.Key)) &&
                   WaveStats.OrderBy(ws => ws.Key).SequenceEqual(other.WaveStats.OrderBy(ws => ws.Key)));
        }
Пример #2
0
 public void BeginWave(WaveStats stats)
 {
     waveStarted.Invoke();
     waveStats = stats;
     enemySpawner.spawnInterval = waveStats.spawnInterval;
     StartCoroutine(Spawn());
 }
Пример #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = CardStats?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ ComputerDifficulty.GetHashCode();
         hashCode = (hashCode * 397) ^ ComputerPlayerId.GetHashCode();
         hashCode = (hashCode * 397) ^ (ExperienceProgress != null ? ExperienceProgress.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (HumanPlayerId != null ? HumanPlayerId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsHuman.GetHashCode();
         hashCode = (hashCode * 397) ^ LeaderId;
         hashCode = (hashCode * 397) ^ (LeaderPowerStats?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ PlayerCompletedMatch.GetHashCode();
         hashCode = (hashCode * 397) ^ PlayerMatchOutcome.GetHashCode();
         hashCode = (hashCode * 397) ^ (PointStats?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (RatingProgress != null ? RatingProgress.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ TeamId;
         hashCode = (hashCode * 397) ^ TeamPlayerIndex;
         hashCode = (hashCode * 397) ^ TimeInMatch.GetHashCode();
         hashCode = (hashCode * 397) ^ (UnitStats?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (WaveStats?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }