Пример #1
0
 public Species(
     int id,
     string name,
     ISpeciesStat health,
     ISpeciesStat attack,
     ISpeciesStat defense,
     ISpeciesStat special,
     ISpeciesStat speed,
     decimal weight,
     decimal height,
     IReadOnlyIndexedSet <IType> types,
     IReadOnlyIndexedSet <IMove> moves,
     ITier tier)
 {
     Id      = id;
     Name    = name;
     Health  = health;
     Attack  = attack;
     Defense = defense;
     Special = special;
     Speed   = speed;
     Weight  = weight;
     Height  = height;
     Types   = types;
     Moves   = moves;
     Tier    = tier;
 }
        public PermanentStatBuilder Stat(StatType type, ISpeciesStat stat)
        {
            var permanentType = type switch
            {
                StatType.Health => PermanentStatType.Health,
                StatType.Attack => PermanentStatType.Attack,
                StatType.Defense => PermanentStatType.Defense,
                StatType.Special => PermanentStatType.Special,
                StatType.Speed => PermanentStatType.Speed,
                _ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
            };

            BaseValues[permanentType] = stat.Value;

            return(this);
        }