Beispiel #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Type != 0)
            {
                hash ^= Type.GetHashCode();
            }
            if (ActionStartMs != 0L)
            {
                hash ^= ActionStartMs.GetHashCode();
            }
            if (DurationMs != 0)
            {
                hash ^= DurationMs.GetHashCode();
            }
            if (EnergyDelta != 0)
            {
                hash ^= EnergyDelta.GetHashCode();
            }
            if (AttackerIndex != 0)
            {
                hash ^= AttackerIndex.GetHashCode();
            }
            if (TargetIndex != 0)
            {
                hash ^= TargetIndex.GetHashCode();
            }
            if (ActivePokemonId != 0UL)
            {
                hash ^= ActivePokemonId.GetHashCode();
            }
            if (playerJoined_ != null)
            {
                hash ^= PlayerJoined.GetHashCode();
            }
            if (battleResults_ != null)
            {
                hash ^= BattleResults.GetHashCode();
            }
            if (DamageWindowsStartTimestampMss != 0L)
            {
                hash ^= DamageWindowsStartTimestampMss.GetHashCode();
            }
            if (DamageWindowsEndTimestampMss != 0L)
            {
                hash ^= DamageWindowsEndTimestampMss.GetHashCode();
            }
            if (playerLeft_ != null)
            {
                hash ^= PlayerLeft.GetHashCode();
            }
            if (TargetPokemonId != 0UL)
            {
                hash ^= TargetPokemonId.GetHashCode();
            }
            return(hash);
        }
Beispiel #2
0
 public void MergeFrom(BattleAction other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Type != 0)
     {
         Type = other.Type;
     }
     if (other.ActionStartMs != 0L)
     {
         ActionStartMs = other.ActionStartMs;
     }
     if (other.DurationMs != 0)
     {
         DurationMs = other.DurationMs;
     }
     if (other.EnergyDelta != 0)
     {
         EnergyDelta = other.EnergyDelta;
     }
     if (other.AttackerIndex != 0)
     {
         AttackerIndex = other.AttackerIndex;
     }
     if (other.TargetIndex != 0)
     {
         TargetIndex = other.TargetIndex;
     }
     if (other.ActivePokemonId != 0UL)
     {
         ActivePokemonId = other.ActivePokemonId;
     }
     if (other.playerJoined_ != null)
     {
         if (playerJoined_ == null)
         {
             playerJoined_ = new global::PokemonGoDesktop.API.Proto.BattleParticipant();
         }
         PlayerJoined.MergeFrom(other.PlayerJoined);
     }
     if (other.battleResults_ != null)
     {
         if (battleResults_ == null)
         {
             battleResults_ = new global::PokemonGoDesktop.API.Proto.BattleResults();
         }
         BattleResults.MergeFrom(other.BattleResults);
     }
     if (other.DamageWindowsStartTimestampMss != 0L)
     {
         DamageWindowsStartTimestampMss = other.DamageWindowsStartTimestampMss;
     }
     if (other.DamageWindowsEndTimestampMss != 0L)
     {
         DamageWindowsEndTimestampMss = other.DamageWindowsEndTimestampMss;
     }
     if (other.playerLeft_ != null)
     {
         if (playerLeft_ == null)
         {
             playerLeft_ = new global::PokemonGoDesktop.API.Proto.BattleParticipant();
         }
         PlayerLeft.MergeFrom(other.PlayerLeft);
     }
     if (other.TargetPokemonId != 0UL)
     {
         TargetPokemonId = other.TargetPokemonId;
     }
 }