示例#1
0
 private PokemonForm(
     string name,
     GenerationId generationId,
     PokedexNumber speciesId,
     Height height,
     Weight weight,
     PokemonTypeId primaryTypeId,
     PokemonTypeId?secondaryTypeId = null,
     Url?imageUrl       = null,
     string?description = null,
     bool isDefault     = false) : base(name)
 {
     GenerationId = Guard.Against.Null(generationId, nameof(generationId));
     SpeciesId    = Guard.Against.Null(speciesId, nameof(speciesId));
     IsDefault    = isDefault;
     Height       = Guard.Against.Null(height, nameof(height));
     Weight       = Guard.Against.Null(weight, nameof(weight));
     ImageUrl     = imageUrl;
     Description  = description;
     UpdateTypes(primaryTypeId, secondaryTypeId);
 }
示例#2
0
 internal static PokemonForm CreateDefaultForm(
     string name,
     GenerationId generationId,
     PokedexNumber speciesId,
     Height height,
     Weight weight,
     PokemonTypeId primaryTypeId,
     PokemonTypeId?secondaryTypeId = null,
     Url?imageUrl       = null,
     string?description = null)
 {
     return(new PokemonForm(
                name,
                generationId,
                speciesId,
                height,
                weight,
                primaryTypeId,
                secondaryTypeId,
                imageUrl,
                description,
                true));
 }
示例#3
0
 public void UpdateTypes(PokemonTypeId primaryTypeId, PokemonTypeId?secondaryTypeId)
 {
     PrimaryTypeId   = Guard.Against.Null(primaryTypeId, nameof(primaryTypeId));
     SecondaryTypeId = secondaryTypeId;
 }