internal static void ToBytes(this IPBEReadOnlyStatCollection stats, EndianBinaryWriter w)
 {
     w.Write(stats.HP);
     w.Write(stats.Attack);
     w.Write(stats.Defense);
     w.Write(stats.SpAttack);
     w.Write(stats.SpDefense);
     w.Write(stats.Speed);
 }
Exemplo n.º 2
0
 public IVs(IPBEReadOnlyStatCollection other)
 {
     HP        = other.HP;
     Attack    = other.Attack;
     Defense   = other.Defense;
     SpAttack  = other.SpAttack;
     SpDefense = other.SpDefense;
     Speed     = other.Speed;
 }
 internal static void ToJson(this IPBEReadOnlyStatCollection stats, JsonTextWriter w)
 {
     w.WriteStartObject();
     w.WritePropertyName(nameof(IPBEReadOnlyStatCollection.HP));
     w.WriteValue(stats.HP);
     w.WritePropertyName(nameof(IPBEReadOnlyStatCollection.Attack));
     w.WriteValue(stats.Attack);
     w.WritePropertyName(nameof(IPBEReadOnlyStatCollection.Defense));
     w.WriteValue(stats.Defense);
     w.WritePropertyName(nameof(IPBEReadOnlyStatCollection.SpAttack));
     w.WriteValue(stats.SpAttack);
     w.WritePropertyName(nameof(IPBEReadOnlyStatCollection.SpDefense));
     w.WriteValue(stats.SpDefense);
     w.WritePropertyName(nameof(IPBEReadOnlyStatCollection.Speed));
     w.WriteValue(stats.Speed);
     w.WriteEndObject();
 }
        public static byte GetStat(this IPBEReadOnlyStatCollection stats, PBEStat stat)
        {
            switch (stat)
            {
            case PBEStat.HP: return(stats.HP);

            case PBEStat.Attack: return(stats.Attack);

            case PBEStat.Defense: return(stats.Defense);

            case PBEStat.SpAttack: return(stats.SpAttack);

            case PBEStat.SpDefense: return(stats.SpDefense);

            case PBEStat.Speed: return(stats.Speed);

            default: throw new ArgumentOutOfRangeException(nameof(stat));
            }
        }
 public static PBEType GetHiddenPowerType(this IPBEReadOnlyStatCollection stats)
 {
     return(PBEDataUtils.GetHiddenPowerType(stats.HP, stats.Attack, stats.Defense, stats.SpAttack, stats.SpDefense, stats.Speed));
 }
 public static byte GetHiddenPowerBasePower(this IPBEReadOnlyStatCollection stats, PBESettings settings)
 {
     return(PBEDataUtils.GetHiddenPowerBasePower(stats.HP, stats.Attack, stats.Defense, stats.SpAttack, stats.SpDefense, stats.Speed, settings));
 }
Exemplo n.º 7
0
 public PBEStatCollection(IPBEReadOnlyStatCollection stats)
     : this(stats.HP, stats.Attack, stats.Defense, stats.SpAttack, stats.SpDefense, stats.Speed)
 {
 }