public GymDefender(string fortId, GymDefenderProto proto) { Id = proto.MotivatedPokemon.Pokemon.Id; PokemonId = (ushort)proto.MotivatedPokemon.Pokemon.PokemonId; CpWhenDeployed = (uint)proto.MotivatedPokemon.CpWhenDeployed; CpNow = (uint)proto.MotivatedPokemon.CpNow; BerryValue = proto.MotivatedPokemon.BerryValue; TimesFed = (ushort)proto.DeploymentTotals?.TimesFed; DeploymentDuration = (uint)proto.DeploymentTotals?.DeploymentDurationMs / 1000; TrainerName = proto.MotivatedPokemon.Pokemon.OwnerName; FortId = fortId; AttackIV = (ushort)proto.MotivatedPokemon.Pokemon?.IndividualAttack; DefenseIV = (ushort)proto.MotivatedPokemon.Pokemon?.IndividualDefense; StaminaIV = (ushort)proto.MotivatedPokemon.Pokemon?.IndividualStamina; Move1 = (ushort)proto.MotivatedPokemon.Pokemon?.Move1; Move2 = (ushort)proto.MotivatedPokemon.Pokemon?.Move2; BattlesAttacked = (ushort)proto.MotivatedPokemon.Pokemon.BattlesAttacked; BattlesDefended = (ushort)proto.MotivatedPokemon.Pokemon.BattlesDefended; Gender = (ushort)proto.MotivatedPokemon.Pokemon.PokemonDisplay.Gender; HatchedFromEgg = proto.MotivatedPokemon.Pokemon.HatchedFromEgg; PvpCombatWon = (ushort)(proto.MotivatedPokemon.Pokemon.PvpCombatStats?.NumWon ?? 0); PvpCombatTotal = (ushort)(proto.MotivatedPokemon.Pokemon.PvpCombatStats?.NumTotal ?? 0); NpcCombatWon = (ushort)(proto.MotivatedPokemon.Pokemon.NpcCombatStats?.NumWon ?? 0); NpcCombatTotal = (ushort)(proto.MotivatedPokemon.Pokemon.NpcCombatStats?.NumTotal ?? 0); Updated = DateTime.UtcNow.ToTotalSeconds(); // TODO: New gym defender properties //BuddyCandyAwarded //BuddyKmWalked //DisplayPokemonId //Favorite //Form //EvolutionQuestInfo ?? //HasMegaEvolved //HeightM //IsBad //IsEgg //IsLucky //Move3 //Nickname //OriginDetail //OriginalOwnerNickname, //Pokeball //PokemonDisplay.Form //PokemonDisplay.Costume //TradedTimeMs //WeightKg }
public Trainer(GymDefenderProto proto) { Name = proto.TrainerPublicProfile.Name; Level = (ushort)proto.TrainerPublicProfile.Level; TeamId = (ushort)proto.TrainerPublicProfile.Team; BattlesWon = (uint)(proto.TrainerPublicProfile?.BattlesWon ?? 0); KmWalked = proto.TrainerPublicProfile?.KmWalked ?? 0; PokemonCaught = (ulong)(proto.TrainerPublicProfile?.CaughtPokemon ?? 0); Experience = (ulong)(proto.TrainerPublicProfile?.Experience ?? 0); CombatRank = (ulong)(proto.TrainerPublicProfile?.CombatRank ?? 0); CombatRating = proto.TrainerPublicProfile?.CombatRating ?? 0; Updated = DateTime.UtcNow.ToTotalSeconds(); // TODO: New gym trainer properties //trainerProfile.GymBadgeType (gym badge type) //trainerProfile.HasSharedExPass (invited to ex raid) }