Documentation
¶
Index ¶
- Constants
- Variables
- func ComparePokemonId(p1, p2 *Pokemon) int
- func ImportAbility(studioFolder, translationFolder string) (iter.Seq[*AbilityDescriptor], error)
- func ImportMoves(studioFolder, translationFolder string) (iter.Seq[*MoveDescriptor], error)
- func ImportPokemon(studioFolder, translationFolder string) (iter.Seq[*PokemonDescriptor], error)
- func ImportTypes(studioFolder, translationFolder string) (iter.Seq[*PokemonTypeDescriptor], error)
- func MaxHp(base int32) int32
- func MaxStat(base int32) int32
- func MinHp(base int32) int32
- func MinStat(base int32) int32
- type Ability
- type AbilityBuilder
- func (b *AbilityBuilder) Build() *Ability
- func (b *AbilityBuilder) DbSymbol(dbSymbol string) *AbilityBuilder
- func (b *AbilityBuilder) Description(desc Translation) *AbilityBuilder
- func (b *AbilityBuilder) ID(id int) *AbilityBuilder
- func (b *AbilityBuilder) Name(name Translation) *AbilityBuilder
- func (b *AbilityBuilder) TextId(textId int) *AbilityBuilder
- type AbilityDescriptor
- type AbilityMapper
- type AimedTarget
- type BattleStage
- type BattleStageModDescriptor
- type BreedGroupDescriptor
- type Condition
- type ConditionDescriptor
- type ContactType
- type Evolution
- type EvolutionDescriptor
- type ExecutionMethod
- type ExperienceType
- type ExperienceTypeDescriptor
- type FormDescriptor
- type FormTextIdDescriptor
- type ItemHeld
- type ItemHeldDescriptor
- type Move
- func (m *Move) Accuracy() int
- func (m *Move) Category() MoveCategory
- func (m *Move) CriticalRate() int
- func (m *Move) DbSymbol() string
- func (m *Move) Description(lang string) string
- func (m *Move) Execution() MoveExecution
- func (m *Move) ID() int
- func (m *Move) Interactions() []MoveInteraction
- func (m *Move) MapUse() int
- func (m *Move) MechanicalTags() []MoveMechanicalTag
- func (m *Move) Name(lang string) string
- func (m *Move) PP() int
- func (m *Move) Power() int
- func (m *Move) Priority() int
- func (m *Move) SecondaryEffects() MoveSecondaryEffects
- func (m *Move) Targeting() MoveTargeting
- func (m *Move) Type() PokemonType
- type MoveBuilder
- func (b *MoveBuilder) Accuracy(acc int) *MoveBuilder
- func (b *MoveBuilder) Build() *Move
- func (b *MoveBuilder) Category(cat MoveCategory) *MoveBuilder
- func (b *MoveBuilder) CriticalRate(rate int) *MoveBuilder
- func (b *MoveBuilder) DbSymbol(dbSymbol string) *MoveBuilder
- func (b *MoveBuilder) Description(desc Translation) *MoveBuilder
- func (b *MoveBuilder) Execution(exec MoveExecution) *MoveBuilder
- func (b *MoveBuilder) ID(id int) *MoveBuilder
- func (b *MoveBuilder) Interactions(interactions []MoveInteraction) *MoveBuilder
- func (b *MoveBuilder) MapUse(mapUse int) *MoveBuilder
- func (b *MoveBuilder) MechanicalTags(tags []MoveMechanicalTag) *MoveBuilder
- func (b *MoveBuilder) Name(name Translation) *MoveBuilder
- func (b *MoveBuilder) PP(pp int) *MoveBuilder
- func (b *MoveBuilder) Power(power int) *MoveBuilder
- func (b *MoveBuilder) Priority(priority int) *MoveBuilder
- func (b *MoveBuilder) SecondaryEffects(effects MoveSecondaryEffects) *MoveBuilder
- func (b *MoveBuilder) Targeting(targeting MoveTargeting) *MoveBuilder
- func (b *MoveBuilder) Type(t *PokemonType) *MoveBuilder
- type MoveCategory
- type MoveDescriptor
- type MoveExecution
- type MoveInteraction
- type MoveMapper
- type MoveMechanicalTag
- type MoveSecondaryEffects
- type MoveStatStageChange
- type MoveStatusDescriptor
- type MoveStatusEffect
- type MoveTargeting
- type Pokemon
- type PokemonBuilder
- func (b *PokemonBuilder) Build() *Pokemon
- func (b *PokemonBuilder) CustomProperties(props map[string]any) *PokemonBuilder
- func (b *PokemonBuilder) DbSymbol(dbSymbol string) *PokemonBuilder
- func (b *PokemonBuilder) Forms(forms map[int32]PokemonForm) *PokemonBuilder
- func (b *PokemonBuilder) ID(id int32) *PokemonBuilder
- type PokemonDescriptor
- type PokemonForm
- func (f *PokemonForm) Abilities() iter.Seq[Ability]
- func (f *PokemonForm) Ability(i int) (Ability, bool)
- func (f *PokemonForm) AbilitySymbol(i int) (string, bool)
- func (f *PokemonForm) AbilitySymbols() iter.Seq[string]
- func (f *PokemonForm) BabyDbSymbol() *string
- func (f *PokemonForm) BabyForm() int32
- func (f *PokemonForm) BaseAtk() int32
- func (f *PokemonForm) BaseAts() int32
- func (f *PokemonForm) BaseDfe() int32
- func (f *PokemonForm) BaseDfs() int32
- func (f *PokemonForm) BaseExperience() int32
- func (f *PokemonForm) BaseHp() int32
- func (f *PokemonForm) BaseLoyalty() int32
- func (f *PokemonForm) BaseSpd() int32
- func (f *PokemonForm) BreedGroup(i int) (string, bool)
- func (f *PokemonForm) BreedGroups() iter.Seq[string]
- func (f *PokemonForm) CatchRate() int32
- func (f *PokemonForm) CustomProperties() map[string]any
- func (f *PokemonForm) Description(lang string) string
- func (f *PokemonForm) EvAtk() int32
- func (f *PokemonForm) EvAts() int32
- func (f *PokemonForm) EvDfe() int32
- func (f *PokemonForm) EvDfs() int32
- func (f *PokemonForm) EvHp() int32
- func (f *PokemonForm) EvSpd() int32
- func (f *PokemonForm) Evolution(i int) (Evolution, bool)
- func (f *PokemonForm) Evolutions() iter.Seq[Evolution]
- func (f *PokemonForm) ExperienceType() string
- func (f *PokemonForm) FemaleRate() float32
- func (f *PokemonForm) Form() int32
- func (f *PokemonForm) FrontOffsetY() int32
- func (f *PokemonForm) HatchSteps() int32
- func (f *PokemonForm) Height() float32
- func (f *PokemonForm) Item(i int) (*ItemHeld, bool)
- func (f *PokemonForm) ItemHeld() iter.Seq[*ItemHeld]
- func (f *PokemonForm) Name(lang string) string
- func (f *PokemonForm) Resources() PokemonResources
- func (f *PokemonForm) Type1() PokemonType
- func (f *PokemonForm) Type2() (PokemonType, bool)
- func (f *PokemonForm) Weight() float32
- type PokemonFormBuilder
- func (b *PokemonFormBuilder) Abilities(abilities []*Ability) *PokemonFormBuilder
- func (b *PokemonFormBuilder) AbilitySymbols(symbols []string) *PokemonFormBuilder
- func (b *PokemonFormBuilder) BabyDbSymbol(symbol *string) *PokemonFormBuilder
- func (b *PokemonFormBuilder) BabyForm(form int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) BaseAtk(atk int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) BaseAts(ats int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) BaseDfe(dfe int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) BaseDfs(dfs int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) BaseExperience(exp int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) BaseHp(hp int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) BaseLoyalty(loyalty int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) BaseSpd(spd int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) BreedGroups(groups []string) *PokemonFormBuilder
- func (b *PokemonFormBuilder) Build() *PokemonForm
- func (b *PokemonFormBuilder) CatchRate(rate int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) CustomProperties(props map[string]any) *PokemonFormBuilder
- func (b *PokemonFormBuilder) Description(desc Translation) *PokemonFormBuilder
- func (b *PokemonFormBuilder) EvAtk(atk int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) EvAts(ats int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) EvDfe(dfe int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) EvDfs(dfs int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) EvHp(hp int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) EvSpd(spd int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) Evolutions(evolutions []Evolution) *PokemonFormBuilder
- func (b *PokemonFormBuilder) ExperienceType(expType string) *PokemonFormBuilder
- func (b *PokemonFormBuilder) FemaleRate(rate float32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) Form(form int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) FrontOffsetY(y int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) HatchSteps(steps int32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) Height(h float32) *PokemonFormBuilder
- func (b *PokemonFormBuilder) ItemHeld(items []*ItemHeld) *PokemonFormBuilder
- func (b *PokemonFormBuilder) Name(name Translation) *PokemonFormBuilder
- func (b *PokemonFormBuilder) Resources(resources PokemonResources) *PokemonFormBuilder
- func (b *PokemonFormBuilder) Type1(t *PokemonType) *PokemonFormBuilder
- func (b *PokemonFormBuilder) Type2(t *PokemonType) *PokemonFormBuilder
- func (b *PokemonFormBuilder) Weight(w float32) *PokemonFormBuilder
- type PokemonMapper
- func (m *PokemonMapper) MapBreedGroups(breedGroupInts []int32) []string
- func (m *PokemonMapper) MapConditions(conditions []ConditionDescriptor) []Condition
- func (m *PokemonMapper) MapEvolutions(evolutions []EvolutionDescriptor) []Evolution
- func (m *PokemonMapper) MapFormDescriptorToPokemonForm(desc FormDescriptor) *PokemonForm
- func (m *PokemonMapper) MapItemHelds(itemHelds []ItemHeldDescriptor) []*ItemHeld
- func (m *PokemonMapper) MapPokemonDescriptorToPokemon(desc PokemonDescriptor) *Pokemon
- func (m *PokemonMapper) MapPokemonResources(resources PokemonResourcesDescriptor) PokemonResources
- type PokemonResources
- type PokemonResourcesDescriptor
- type PokemonType
- func (t *PokemonType) Color() string
- func (t *PokemonType) Damage(defType string) (float32, bool)
- func (t *PokemonType) DamageTo() iter.Seq2[string, float32]
- func (t *PokemonType) DamageToTypes(type1, type2 string) float32
- func (t *PokemonType) DbSymbol() string
- func (t *PokemonType) Name(lang string) string
- func (t *PokemonType) TextId() int
- type PokemonTypeDescriptor
- type Store
- func (s *Store) AddAbility(ability Ability) *Ability
- func (s *Store) AddMove(move Move) *Move
- func (s *Store) AddPokemon(pokemon Pokemon) *Pokemon
- func (s *Store) AddType(pokemonType PokemonType) *PokemonType
- func (s *Store) FindAbilityBySymbol(symbol string, filters ...iter2.FilterFunc[Ability]) *Ability
- func (s *Store) FindAllAbilities(filters ...iter2.FilterFunc[Ability]) iter.Seq[Ability]
- func (s *Store) FindAllMoves(filters ...iter2.FilterFunc[Move]) iter.Seq[Move]
- func (s *Store) FindAllPokemon(filters ...iter2.FilterFunc[Pokemon]) iter.Seq[Pokemon]
- func (s *Store) FindAllTypes(filters ...iter2.FilterFunc[PokemonType]) iter.Seq[PokemonType]
- func (s *Store) FindMoveBySymbol(symbol string, filters ...iter2.FilterFunc[Move]) *Move
- func (s *Store) FindPokemonByName(name string, filters ...iter2.FilterFunc[Pokemon]) *Pokemon
- func (s *Store) FindPokemonBySymbol(symbol string, filters ...iter2.FilterFunc[Pokemon]) *Pokemon
- func (s *Store) FindTypeBySymbol(symbol string, filters ...iter2.FilterFunc[PokemonType]) *PokemonType
- func (s *Store) Resistances(type1, type2 string, filters ...iter2.FilterFunc[PokemonType]) iter.Seq2[string, float32]
- type Translation
- type TypeBuilder
- func (b *TypeBuilder) Build() *PokemonType
- func (b *TypeBuilder) Color(color string) *TypeBuilder
- func (b *TypeBuilder) DamageTo(damageTo map[string]float32) *TypeBuilder
- func (b *TypeBuilder) DbSymbol(dbSymbol string) *TypeBuilder
- func (b *TypeBuilder) Name(name Translation) *TypeBuilder
- func (b *TypeBuilder) TextId(id int) *TypeBuilder
- type TypeDamageDescriptor
- type TypeMapper
Constants ¶
const ( ExperienceErratic = "erratic" ExperienceFast = "fast" ExperienceMediumFast = "medium_fast" ExperienceMediumSlow = "medium_slow" ExperienceSlow = "slow" ExperienceFluctuating = "fluctuating" )
ExperienceErratic is the erratic experience type.
const ( BreedMonster = "monster" BreedWater1 = "water1" BreedBug = "bug" BreedFlying = "flying" BreedField = "field" BreedFairy = "fairy" BreedGrass = "grass" BreedHuman = "human-like" BreedWater3 = "water3" BreedMineral = "mineral" BreedAmorphous = "amorphous" BreedWater2 = "water2" BreedDitto = "ditto" BreedDragon = "dragon" BreedUndiscovered = "undiscovered" )
Breed groups constants.
const ( StudioFolder = "Studio" LanguageFolder = "Text/Dialogs" UndefType = "__undef__" )
Variables ¶
var BreedMap = map[BreedGroupDescriptor]string{ BreedMonsterNum: BreedMonster, BreedWater1Num: BreedWater1, BreedBugNum: BreedBug, BreedFlyingNum: BreedFlying, BreedFieldNum: BreedField, BreedFairyNum: BreedFairy, BreedGrassNum: BreedGrass, BreedHumanNum: BreedHuman, BreedWater3Num: BreedWater3, BreedMineralNum: BreedMineral, BreedAmorphousNum: BreedAmorphous, BreedWater2Num: BreedWater2, BreedDittoNum: BreedDitto, BreedDragonNum: BreedDragon, BreedUndiscoveredNum: BreedUndiscovered, }
BreedMap maps breed group descriptors to strings.
var ExperienceTypeMap = map[ExperienceTypeDescriptor]string{ ExperienceErraticNum: ExperienceErratic, ExperienceFastNum: ExperienceFast, ExperienceMediumFastNum: ExperienceMediumFast, ExperienceMediumSlowNum: ExperienceMediumSlow, ExperienceSlowNum: ExperienceSlow, ExperienceFluctuatingNum: ExperienceFluctuating, }
ExperienceTypeMap maps experience type descriptors to strings.
Functions ¶
func ComparePokemonId ¶
ComparePokemonId compares two Pokemon by their ID.
func ImportAbility ¶
func ImportAbility(studioFolder, translationFolder string) (iter.Seq[*AbilityDescriptor], error)
func ImportMoves ¶
func ImportMoves(studioFolder, translationFolder string) (iter.Seq[*MoveDescriptor], error)
ImportMoves import a moves folder to a store studioFolder pokemon studio folder translationFolder the translation folder
func ImportPokemon ¶
func ImportPokemon(studioFolder, translationFolder string) (iter.Seq[*PokemonDescriptor], error)
ImportPokemon import a pokemon folder to a store studioFolder pokemon studio folder translationFolder the translation folder store the store that import is sending data to
func ImportTypes ¶
func ImportTypes(studioFolder, translationFolder string) (iter.Seq[*PokemonTypeDescriptor], error)
ImportTypes import a type folder to a store studioFolder pokemon studio folder translationFolder the translation folder store the store that import is sending data to
Types ¶
type Ability ¶
type Ability struct {
// contains filtered or unexported fields
}
Ability represents a Pokemon ability.
func (Ability) Description ¶
Description returns the localized description of the Ability for the given language.
type AbilityBuilder ¶
type AbilityBuilder struct {
// contains filtered or unexported fields
}
AbilityBuilder builds Ability entities.
func NewAbilityBuilder ¶
func NewAbilityBuilder() *AbilityBuilder
NewAbilityBuilder creates a new AbilityBuilder.
func (*AbilityBuilder) Build ¶
func (b *AbilityBuilder) Build() *Ability
Build returns a copy of the built Ability.
func (*AbilityBuilder) DbSymbol ¶
func (b *AbilityBuilder) DbSymbol(dbSymbol string) *AbilityBuilder
DbSymbol sets the database symbol of the Ability.
func (*AbilityBuilder) Description ¶
func (b *AbilityBuilder) Description(desc Translation) *AbilityBuilder
Description sets the description translations of the Ability.
func (*AbilityBuilder) ID ¶
func (b *AbilityBuilder) ID(id int) *AbilityBuilder
ID sets the ID of the Ability.
func (*AbilityBuilder) Name ¶
func (b *AbilityBuilder) Name(name Translation) *AbilityBuilder
Name sets the name translations of the Ability.
func (*AbilityBuilder) TextId ¶
func (b *AbilityBuilder) TextId(textId int) *AbilityBuilder
TextId sets the text ID of the Ability.
type AbilityDescriptor ¶
type AbilityDescriptor struct {
DbSymbol string `json:"dbSymbol"`
Id int `json:"id"`
TextID int `json:"textId"`
Name Translation
Description Translation
}
AbilityDescriptor is the JSON descriptor for an Ability.
func UnmarshalAbilityDescriptor ¶
func UnmarshalAbilityDescriptor(abilityContent []byte) (*AbilityDescriptor, error)
UnmarshalAbilityDescriptor unmarshal a json encoded ability to a descriptor abilityContent the encoded ability
type AbilityMapper ¶
type AbilityMapper struct {
// contains filtered or unexported fields
}
AbilityMapper maps Ability descriptors to Ability entities.
func NewAbilityMapper ¶
func NewAbilityMapper(store *Store) *AbilityMapper
NewAbilityMapper creates a new AbilityMapper.
func (*AbilityMapper) MapAbilityDescriptorToAbility ¶
func (m *AbilityMapper) MapAbilityDescriptorToAbility(desc AbilityDescriptor) *Ability
MapAbilityDescriptorToAbility maps an AbilityDescriptor to an Ability.
type AimedTarget ¶
type AimedTarget string
AimedTarget represents the target of a move
const ( AimedTargetAdjacentPokemon AimedTarget = "adjacent_pokemon" AimedTargetAdjacentFoe AimedTarget = "adjacent_foe" AimedTargetAdjacentAllFoe AimedTarget = "adjacent_all_foe" AimedTargetAllFoe AimedTarget = "all_foe" AimedTargetAdjacentAllPokemon AimedTarget = "adjacent_all_pokemon" AimedTargetAllPokemon AimedTarget = "all_pokemon" AimedTargetUser AimedTarget = "user" AimedTargetUserOrAdjacentAlly AimedTarget = "user_or_adjacent_ally" AimedTargetAdjacentAlly AimedTarget = "adjacent_ally" AimedTargetAllAlly AimedTarget = "all_ally" AimedTargetAllAllyButUser AimedTarget = "all_ally_but_user" AimedTargetAnyOtherPokemon AimedTarget = "any_other_pokemon" AimedTargetRandomFoe AimedTarget = "random_foe" )
type BattleStage ¶
type BattleStage string
BattleStage represents a stat stage in battle
const ( BattleStageATK BattleStage = "ATK_STAGE" BattleStageDFE BattleStage = "DFE_STAGE" BattleStageATS BattleStage = "ATS_STAGE" BattleStageDFS BattleStage = "DFS_STAGE" BattleStageSPD BattleStage = "SPD_STAGE" BattleStageEVA BattleStage = "EVA_STAGE" BattleStageACC BattleStage = "ACC_STAGE" )
type BreedGroupDescriptor ¶
type BreedGroupDescriptor int32
BreedGroupDescriptor is a numeric descriptor for breed groups.
const ( BreedMonsterNum BreedGroupDescriptor = 1 BreedWater1Num BreedGroupDescriptor = 2 BreedBugNum BreedGroupDescriptor = 3 BreedFlyingNum BreedGroupDescriptor = 4 BreedFieldNum BreedGroupDescriptor = 5 BreedFairyNum BreedGroupDescriptor = 6 BreedGrassNum BreedGroupDescriptor = 7 BreedHumanNum BreedGroupDescriptor = 8 BreedWater3Num BreedGroupDescriptor = 9 BreedMineralNum BreedGroupDescriptor = 10 BreedAmorphousNum BreedGroupDescriptor = 11 BreedWater2Num BreedGroupDescriptor = 12 BreedDittoNum BreedGroupDescriptor = 13 BreedDragonNum BreedGroupDescriptor = 14 BreedUndiscoveredNum BreedGroupDescriptor = 15 )
type Condition ¶
type Condition struct {
Type string
}
Condition represents a condition for evolution.
type ConditionDescriptor ¶
type ConditionDescriptor struct {
Type string `json:"type"`
}
ConditionDescriptor is the JSON descriptor for an evolution condition.
type ContactType ¶
type ContactType string
ContactType represents how a move makes contact
const ( ContactTypeDirect ContactType = "DIRECT" ContactTypeDistant ContactType = "DISTANT" ContactTypeNone ContactType = "NONE" )
type EvolutionDescriptor ¶
type EvolutionDescriptor struct {
DbSymbol string `json:"dbSymbol"`
Form int32 `json:"form"`
Conditions []ConditionDescriptor `json:"conditions"`
}
EvolutionDescriptor is the JSON descriptor for an evolution.
type ExecutionMethod ¶
type ExecutionMethod string
ExecutionMethod represents how a move is executed
const ( ExecutionMethodBasic ExecutionMethod = "s_basic" ExecutionMethodStat ExecutionMethod = "s_stat" ExecutionMethodStatus ExecutionMethod = "s_status" ExecutionMethodMultiHit ExecutionMethod = "s_multi_hit" ExecutionMethod2Hits ExecutionMethod = "s_2hits" ExecutionMethodOHKO ExecutionMethod = "s_ohko" ExecutionMethod2Turns ExecutionMethod = "s_2turns" ExecutionMethodSelfStat ExecutionMethod = "s_self_stat" ExecutionMethodSelfStatus ExecutionMethod = "s_self_status" )
type ExperienceType ¶
type ExperienceType string
ExperienceType is a type alias for experience types.
type ExperienceTypeDescriptor ¶
type ExperienceTypeDescriptor int32
ExperienceTypeDescriptor is a numeric descriptor for experience types.
const ( ExperienceErraticNum ExperienceTypeDescriptor = 0 ExperienceFastNum ExperienceTypeDescriptor = 1 ExperienceMediumFastNum ExperienceTypeDescriptor = 2 ExperienceMediumSlowNum ExperienceTypeDescriptor = 3 ExperienceSlowNum ExperienceTypeDescriptor = 4 ExperienceFluctuatingNum ExperienceTypeDescriptor = 5 )
type FormDescriptor ¶
type FormDescriptor struct {
Form int32 `json:"form"`
Height float32 `json:"height"`
Weight float32 `json:"weight"`
Type1 string `json:"type1"`
Type2 *string `json:"type2"`
BaseHp int32 `json:"baseHp"`
BaseAtk int32 `json:"baseAtk"`
BaseDfe int32 `json:"baseDfe"`
BaseSpd int32 `json:"baseSpd"`
BaseAts int32 `json:"baseAts"`
BaseDfs int32 `json:"baseDfs"`
EvHp int32 `json:"evHp"`
EvAtk int32 `json:"evAtk"`
EvDfe int32 `json:"evDfe"`
EvSpd int32 `json:"evSpd"`
EvAts int32 `json:"evAts"`
EvDfs int32 `json:"evDfs"`
Evolutions []EvolutionDescriptor `json:"evolutions"`
ExperienceType ExperienceTypeDescriptor `json:"experienceType"`
BaseExperience int32 `json:"baseExperience"`
BaseLoyalty int32 `json:"baseLoyalty"`
CatchRate int32 `json:"catchRate"`
FemaleRate float32 `json:"femaleRate"`
BreedGroups []int32 `json:"breedGroups"`
HatchSteps int32 `json:"hatchSteps"`
BabyDbSymbol *string `json:"babyDbSymbol"`
BabyForm int32 `json:"babyForm"`
ItemHeld []ItemHeldDescriptor `json:"itemHeld"`
Abilities []string `json:"abilities"`
FrontOffsetY int32 `json:"frontOffsetY"`
FormTextId FormTextIdDescriptor `json:"formTextId"`
Resources PokemonResourcesDescriptor `json:"resources"`
Name Translation
Description Translation
}
FormDescriptor is the JSON descriptor for a Pokemon form.
type FormTextIdDescriptor ¶
FormTextIdDescriptor is the JSON descriptor for form text IDs.
type ItemHeldDescriptor ¶
ItemHeldDescriptor is the JSON descriptor for a held item.
type Move ¶
type Move struct {
// contains filtered or unexported fields
}
Move represents a Pokemon move.
func (*Move) Category ¶
func (m *Move) Category() MoveCategory
Category returns the category of the Move.
func (*Move) CriticalRate ¶
CriticalRate returns the critical rate of the Move.
func (*Move) Description ¶
Description returns the localized description of the Move for the given language.
func (*Move) Execution ¶
func (m *Move) Execution() MoveExecution
Execution returns the execution of the Move.
func (*Move) Interactions ¶
func (m *Move) Interactions() []MoveInteraction
Interactions returns the interactions of the Move.
func (*Move) MechanicalTags ¶
func (m *Move) MechanicalTags() []MoveMechanicalTag
MechanicalTags returns the mechanical tags of the Move.
func (*Move) SecondaryEffects ¶
func (m *Move) SecondaryEffects() MoveSecondaryEffects
SecondaryEffects returns the secondary effects of the Move.
func (*Move) Targeting ¶
func (m *Move) Targeting() MoveTargeting
Targeting returns the targeting of the Move.
type MoveBuilder ¶
type MoveBuilder struct {
// contains filtered or unexported fields
}
MoveBuilder builds Move entities.
func (*MoveBuilder) Accuracy ¶
func (b *MoveBuilder) Accuracy(acc int) *MoveBuilder
Accuracy sets the accuracy of a Move.
func (*MoveBuilder) Build ¶
func (b *MoveBuilder) Build() *Move
Build returns a copy of the built Move.
func (*MoveBuilder) Category ¶
func (b *MoveBuilder) Category(cat MoveCategory) *MoveBuilder
Category sets the category of a Move.
func (*MoveBuilder) CriticalRate ¶
func (b *MoveBuilder) CriticalRate(rate int) *MoveBuilder
CriticalRate sets the critical rate of a Move.
func (*MoveBuilder) DbSymbol ¶
func (b *MoveBuilder) DbSymbol(dbSymbol string) *MoveBuilder
DbSymbol sets the database symbol of a Move.
func (*MoveBuilder) Description ¶
func (b *MoveBuilder) Description(desc Translation) *MoveBuilder
Description sets the description translations of a Move.
func (*MoveBuilder) Execution ¶
func (b *MoveBuilder) Execution(exec MoveExecution) *MoveBuilder
Execution sets the execution of a Move.
func (*MoveBuilder) Interactions ¶
func (b *MoveBuilder) Interactions(interactions []MoveInteraction) *MoveBuilder
Interactions sets the interactions of a Move.
func (*MoveBuilder) MapUse ¶
func (b *MoveBuilder) MapUse(mapUse int) *MoveBuilder
MapUse sets the map use of a Move.
func (*MoveBuilder) MechanicalTags ¶
func (b *MoveBuilder) MechanicalTags(tags []MoveMechanicalTag) *MoveBuilder
MechanicalTags sets the mechanical tags of a Move.
func (*MoveBuilder) Name ¶
func (b *MoveBuilder) Name(name Translation) *MoveBuilder
Name sets the name translations of a Move.
func (*MoveBuilder) Power ¶
func (b *MoveBuilder) Power(power int) *MoveBuilder
Power sets the power of a Move.
func (*MoveBuilder) Priority ¶
func (b *MoveBuilder) Priority(priority int) *MoveBuilder
Priority sets the priority of a Move.
func (*MoveBuilder) SecondaryEffects ¶
func (b *MoveBuilder) SecondaryEffects(effects MoveSecondaryEffects) *MoveBuilder
SecondaryEffects sets the secondary effects of a Move.
func (*MoveBuilder) Targeting ¶
func (b *MoveBuilder) Targeting(targeting MoveTargeting) *MoveBuilder
Targeting sets the targeting of a Move.
func (*MoveBuilder) Type ¶
func (b *MoveBuilder) Type(t *PokemonType) *MoveBuilder
Type sets the type of a Move.
type MoveCategory ¶
type MoveCategory string
MoveCategory represents a move category (Physical, Special, Status).
type MoveDescriptor ¶
type MoveDescriptor struct {
Klass string `json:"klass"`
Id int `json:"id"`
DbSymbol string `json:"dbSymbol"`
MapUse int `json:"mapUse"`
BattleEngineMethod string `json:"battleEngineMethod"`
Type string `json:"type"`
Power int `json:"power"`
Accuracy int `json:"accuracy"`
PP int `json:"pp"`
Category string `json:"category"`
MoveCriticalRate int `json:"movecriticalRate"`
Priority int `json:"priority"`
IsAuthentic bool `json:"isAuthentic"`
IsBallistics bool `json:"isBallistics"`
IsBite bool `json:"isBite"`
IsBlocable bool `json:"isBlocable"`
IsCharge bool `json:"isCharge"`
IsDance bool `json:"isDance"`
IsDirect bool `json:"isDirect"`
IsDistance bool `json:"isDistance"`
IsEffectChance bool `json:"isEffectChance"`
IsGravity bool `json:"isGravity"`
IsHeal bool `json:"isHeal"`
IsKingRockUtility bool `json:"isKingRockUtility"`
IsMagicCoatAffected bool `json:"isMagicCoatAffected"`
IsMental bool `json:"isMental"`
IsMirrorMove bool `json:"isMirrorMove"`
IsNonSkyBattle bool `json:"isNonSkyBattle"`
IsPowder bool `json:"isPowder"`
IsPulse bool `json:"isPulse"`
IsPunch bool `json:"isPunch"`
IsRecharge bool `json:"isRecharge"`
IsSnatchable bool `json:"isSnatchable"`
IsSoundAttack bool `json:"isSoundAttack"`
IsUnfreeze bool `json:"isUnfreeze"`
BattleEngineAimedTarget string `json:"battleEngineAimedTarget"`
BattleStageMod []BattleStageModDescriptor `json:"battleStageMod"`
MoveStatus []MoveStatusDescriptor `json:"moveStatus"`
EffectChance int `json:"effectChance"`
IsSlicingAttack bool `json:"isSlicingAttack"`
IsWind bool `json:"isWind"`
Name Translation
Description Translation
}
MoveDescriptor is the JSON descriptor for a Move.
func UnmarshalMoveDescriptor ¶
func UnmarshalMoveDescriptor(moveContent []byte) (*MoveDescriptor, error)
UnmarshalMoveDescriptor unmarshal a json encoded move to a descriptor moveContent the encoded move
type MoveExecution ¶
type MoveExecution struct {
Method ExecutionMethod
Charge bool
Recharge bool
}
MoveExecution contains execution information for a move
type MoveInteraction ¶
type MoveInteraction string
MoveInteraction represents an interaction property of a move
const ( InteractionBlocable MoveInteraction = "BLOCABLE" InteractionMirrorMove MoveInteraction = "MIRROR_MOVE" InteractionSnatchable MoveInteraction = "SNATCHABLE" InteractionMagicCoatAffected MoveInteraction = "MAGIC_COAT_AFFECTED" InteractionKingRockUtility MoveInteraction = "KING_ROCK_UTILITY" InteractionAffectedByGravity MoveInteraction = "AFFECTED_BY_GRAVITY" InteractionNonSkyBattle MoveInteraction = "NON_SKY_BATTLE" )
type MoveMapper ¶
type MoveMapper struct {
// contains filtered or unexported fields
}
MoveMapper handles mapping of Move descriptors using a store
func NewMoveMapper ¶
func NewMoveMapper(store *Store) *MoveMapper
NewMoveMapper creates a new MoveMapper with the given store
func (*MoveMapper) MapMoveDescriptorToMove ¶
func (m *MoveMapper) MapMoveDescriptorToMove(desc MoveDescriptor) *Move
MapMoveDescriptorToMove converts a MoveDescriptor to a Move domain struct
type MoveMechanicalTag ¶
type MoveMechanicalTag string
const ( MechanicalTagAuthentic MoveMechanicalTag = "AUTHENTIC" MechanicalTagBallistic MoveMechanicalTag = "BALLISTIC" MechanicalTagBite MoveMechanicalTag = "BITE" MechanicalTagDance MoveMechanicalTag = "DANCE" MechanicalTagPunch MoveMechanicalTag = "PUNCH" MechanicalTagSlice MoveMechanicalTag = "SLICE" MechanicalTagSound MoveMechanicalTag = "SOUND" MechanicalTagWind MoveMechanicalTag = "WIND" MechanicalTagPulse MoveMechanicalTag = "PULSE" MechanicalTagPowder MoveMechanicalTag = "POWDER" MechanicalTagMental MoveMechanicalTag = "MENTAL" )
type MoveSecondaryEffects ¶
type MoveSecondaryEffects struct {
Chance int
StatusEffects []MoveStatusEffect
StatStageChanges []MoveStatStageChange
}
MoveSecondaryEffects contains secondary effects of a move
type MoveStatStageChange ¶
type MoveStatStageChange struct {
BattleStage BattleStage
Modificator int
}
MoveStatStageChange represents a stat stage modification
type MoveStatusDescriptor ¶
type MoveStatusEffect ¶
MoveStatusEffect represents a status effect applied by a move
type MoveTargeting ¶
type MoveTargeting struct {
AimedTarget AimedTarget
ContactType ContactType
}
MoveTargeting contains targeting information for a move
type Pokemon ¶
type Pokemon struct {
// contains filtered or unexported fields
}
Pokemon represents a Pokémon species with all its forms.
func (*Pokemon) CustomProperties ¶
CustomProperties returns the custom properties of the Pokemon.
func (*Pokemon) Form ¶
func (p *Pokemon) Form(form int32) (PokemonForm, bool)
Form returns a specific form of the Pokemon by its form number.
type PokemonBuilder ¶
type PokemonBuilder struct {
// contains filtered or unexported fields
}
PokemonBuilder builds Pokemon entities.
func NewPokemonBuilder ¶
func NewPokemonBuilder() *PokemonBuilder
NewPokemonBuilder creates a new PokemonBuilder.
func (*PokemonBuilder) Build ¶
func (b *PokemonBuilder) Build() *Pokemon
Build returns a copy of the built Pokemon.
func (*PokemonBuilder) CustomProperties ¶
func (b *PokemonBuilder) CustomProperties(props map[string]any) *PokemonBuilder
CustomProperties sets custom properties for the Pokemon.
func (*PokemonBuilder) DbSymbol ¶
func (b *PokemonBuilder) DbSymbol(dbSymbol string) *PokemonBuilder
DbSymbol sets the database symbol of the Pokemon.
func (*PokemonBuilder) Forms ¶
func (b *PokemonBuilder) Forms(forms map[int32]PokemonForm) *PokemonBuilder
Forms sets the forms of the Pokemon.
func (*PokemonBuilder) ID ¶
func (b *PokemonBuilder) ID(id int32) *PokemonBuilder
ID sets the ID of the Pokemon.
type PokemonDescriptor ¶
type PokemonDescriptor struct {
ID int32 `json:"id"`
DbSymbol string `json:"dbSymbol"`
Forms []FormDescriptor `json:"forms"`
Name Translation
Description Translation
}
PokemonDescriptor is the JSON descriptor for a Pokemon.
func UnmarshalPokemonDescriptor ¶
func UnmarshalPokemonDescriptor(pokemonContent []byte) (*PokemonDescriptor, error)
UnmarshalPokemonDescriptor unmarshal a json encoded pokemon to a descriptor pokemonContent the encoded pokemon
type PokemonForm ¶
type PokemonForm struct {
// contains filtered or unexported fields
}
PokemonForm represents a specific form of a Pokemon species.
func (*PokemonForm) Abilities ¶
func (f *PokemonForm) Abilities() iter.Seq[Ability]
Abilities returns an iterator over the abilities of the PokemonForm.
func (*PokemonForm) Ability ¶
func (f *PokemonForm) Ability(i int) (Ability, bool)
Ability returns a specific ability by index.
func (*PokemonForm) AbilitySymbol ¶
func (f *PokemonForm) AbilitySymbol(i int) (string, bool)
AbilitySymbol returns a specific ability symbol by index.
func (*PokemonForm) AbilitySymbols ¶
func (f *PokemonForm) AbilitySymbols() iter.Seq[string]
AbilitySymbols returns an iterator over the ability symbols of the PokemonForm.
func (*PokemonForm) BabyDbSymbol ¶
func (f *PokemonForm) BabyDbSymbol() *string
BabyDbSymbol returns the baby Pokemon database symbol of the PokemonForm.
func (*PokemonForm) BabyForm ¶
func (f *PokemonForm) BabyForm() int32
BabyForm returns the baby form number of the PokemonForm.
func (*PokemonForm) BaseAtk ¶
func (f *PokemonForm) BaseAtk() int32
BaseAtk returns the base Attack of the PokemonForm.
func (*PokemonForm) BaseAts ¶
func (f *PokemonForm) BaseAts() int32
BaseAts returns the base Special Attack of the PokemonForm.
func (*PokemonForm) BaseDfe ¶
func (f *PokemonForm) BaseDfe() int32
BaseDfe returns the base Defense of the PokemonForm.
func (*PokemonForm) BaseDfs ¶
func (f *PokemonForm) BaseDfs() int32
BaseDfs returns the base Special Defense of the PokemonForm.
func (*PokemonForm) BaseExperience ¶
func (f *PokemonForm) BaseExperience() int32
BaseExperience returns the base experience of the PokemonForm.
func (*PokemonForm) BaseHp ¶
func (f *PokemonForm) BaseHp() int32
BaseHp returns the base HP of the PokemonForm.
func (*PokemonForm) BaseLoyalty ¶
func (f *PokemonForm) BaseLoyalty() int32
BaseLoyalty returns the base loyalty of the PokemonForm.
func (*PokemonForm) BaseSpd ¶
func (f *PokemonForm) BaseSpd() int32
BaseSpd returns the base Speed of the PokemonForm.
func (*PokemonForm) BreedGroup ¶
func (f *PokemonForm) BreedGroup(i int) (string, bool)
BreedGroup returns a specific breed group by index.
func (*PokemonForm) BreedGroups ¶
func (f *PokemonForm) BreedGroups() iter.Seq[string]
BreedGroups returns an iterator over the breed groups of the PokemonForm.
func (*PokemonForm) CatchRate ¶
func (f *PokemonForm) CatchRate() int32
CatchRate returns the catch rate of the PokemonForm.
func (*PokemonForm) CustomProperties ¶
func (f *PokemonForm) CustomProperties() map[string]any
CustomProperties returns the custom properties of the PokemonForm.
func (*PokemonForm) Description ¶
func (f *PokemonForm) Description(lang string) string
Description returns the description translations of the PokemonForm.
func (*PokemonForm) EvAtk ¶
func (f *PokemonForm) EvAtk() int32
EvAtk returns the EV yield for Attack of the PokemonForm.
func (*PokemonForm) EvAts ¶
func (f *PokemonForm) EvAts() int32
EvAts returns the EV yield for Special Attack of the PokemonForm.
func (*PokemonForm) EvDfe ¶
func (f *PokemonForm) EvDfe() int32
EvDfe returns the EV yield for Defense of the PokemonForm.
func (*PokemonForm) EvDfs ¶
func (f *PokemonForm) EvDfs() int32
EvDfs returns the EV yield for Special Defense of the PokemonForm.
func (*PokemonForm) EvHp ¶
func (f *PokemonForm) EvHp() int32
EvHp returns the EV yield for HP of the PokemonForm.
func (*PokemonForm) EvSpd ¶
func (f *PokemonForm) EvSpd() int32
EvSpd returns the EV yield for Speed of the PokemonForm.
func (*PokemonForm) Evolution ¶
func (f *PokemonForm) Evolution(i int) (Evolution, bool)
Evolution returns a specific evolution by index.
func (*PokemonForm) Evolutions ¶
func (f *PokemonForm) Evolutions() iter.Seq[Evolution]
Evolutions returns an iterator over the evolutions of the PokemonForm.
func (*PokemonForm) ExperienceType ¶
func (f *PokemonForm) ExperienceType() string
ExperienceType returns the experience type of the PokemonForm.
func (*PokemonForm) FemaleRate ¶
func (f *PokemonForm) FemaleRate() float32
FemaleRate returns the female rate of the PokemonForm.
func (*PokemonForm) Form ¶
func (f *PokemonForm) Form() int32
Form returns the form number of the PokemonForm.
func (*PokemonForm) FrontOffsetY ¶
func (f *PokemonForm) FrontOffsetY() int32
FrontOffsetY returns the front offset Y of the PokemonForm.
func (*PokemonForm) HatchSteps ¶
func (f *PokemonForm) HatchSteps() int32
HatchSteps returns the hatch steps of the PokemonForm.
func (*PokemonForm) Height ¶
func (f *PokemonForm) Height() float32
Height returns the height of the PokemonForm in meters.
func (*PokemonForm) Item ¶
func (f *PokemonForm) Item(i int) (*ItemHeld, bool)
Item returns a specific held item by index.
func (*PokemonForm) ItemHeld ¶
func (f *PokemonForm) ItemHeld() iter.Seq[*ItemHeld]
ItemHeld returns an iterator over the items held by the PokemonForm.
func (*PokemonForm) Name ¶
func (f *PokemonForm) Name(lang string) string
Name returns the name translations of the PokemonForm.
func (*PokemonForm) Resources ¶
func (f *PokemonForm) Resources() PokemonResources
Resources returns the resources of the PokemonForm.
func (*PokemonForm) Type1 ¶
func (f *PokemonForm) Type1() PokemonType
Type1 returns the primary type of the PokemonForm.
func (*PokemonForm) Type2 ¶
func (f *PokemonForm) Type2() (PokemonType, bool)
Type2 returns the secondary type of the PokemonForm.
func (*PokemonForm) Weight ¶
func (f *PokemonForm) Weight() float32
Weight returns the weight of the PokemonForm in hectograms.
type PokemonFormBuilder ¶
type PokemonFormBuilder struct {
// contains filtered or unexported fields
}
PokemonFormBuilder builds PokemonForm entities.
func NewPokemonFormBuilder ¶
func NewPokemonFormBuilder() *PokemonFormBuilder
NewPokemonFormBuilder creates a new PokemonFormBuilder.
func (*PokemonFormBuilder) Abilities ¶
func (b *PokemonFormBuilder) Abilities(abilities []*Ability) *PokemonFormBuilder
Abilities sets the abilities of the PokemonForm.
func (*PokemonFormBuilder) AbilitySymbols ¶
func (b *PokemonFormBuilder) AbilitySymbols(symbols []string) *PokemonFormBuilder
AbilitySymbols sets the ability symbols of the PokemonForm.
func (*PokemonFormBuilder) BabyDbSymbol ¶
func (b *PokemonFormBuilder) BabyDbSymbol(symbol *string) *PokemonFormBuilder
BabyDbSymbol sets the baby Pokemon database symbol of the PokemonForm.
func (*PokemonFormBuilder) BabyForm ¶
func (b *PokemonFormBuilder) BabyForm(form int32) *PokemonFormBuilder
BabyForm sets the baby form number of the PokemonForm.
func (*PokemonFormBuilder) BaseAtk ¶
func (b *PokemonFormBuilder) BaseAtk(atk int32) *PokemonFormBuilder
BaseAtk sets the base Attack of the PokemonForm.
func (*PokemonFormBuilder) BaseAts ¶
func (b *PokemonFormBuilder) BaseAts(ats int32) *PokemonFormBuilder
BaseAts sets the base Special Attack of the PokemonForm.
func (*PokemonFormBuilder) BaseDfe ¶
func (b *PokemonFormBuilder) BaseDfe(dfe int32) *PokemonFormBuilder
BaseDfe sets the base Defense of the PokemonForm.
func (*PokemonFormBuilder) BaseDfs ¶
func (b *PokemonFormBuilder) BaseDfs(dfs int32) *PokemonFormBuilder
BaseDfs sets the base Special Defense of the PokemonForm.
func (*PokemonFormBuilder) BaseExperience ¶
func (b *PokemonFormBuilder) BaseExperience(exp int32) *PokemonFormBuilder
BaseExperience sets the base experience of the PokemonForm.
func (*PokemonFormBuilder) BaseHp ¶
func (b *PokemonFormBuilder) BaseHp(hp int32) *PokemonFormBuilder
BaseHp sets the base HP of the PokemonForm.
func (*PokemonFormBuilder) BaseLoyalty ¶
func (b *PokemonFormBuilder) BaseLoyalty(loyalty int32) *PokemonFormBuilder
BaseLoyalty sets the base loyalty of the PokemonForm.
func (*PokemonFormBuilder) BaseSpd ¶
func (b *PokemonFormBuilder) BaseSpd(spd int32) *PokemonFormBuilder
BaseSpd sets the base Speed of the PokemonForm.
func (*PokemonFormBuilder) BreedGroups ¶
func (b *PokemonFormBuilder) BreedGroups(groups []string) *PokemonFormBuilder
BreedGroups sets the breed groups of the PokemonForm.
func (*PokemonFormBuilder) Build ¶
func (b *PokemonFormBuilder) Build() *PokemonForm
Build returns a copy of the built PokemonForm.
func (*PokemonFormBuilder) CatchRate ¶
func (b *PokemonFormBuilder) CatchRate(rate int32) *PokemonFormBuilder
CatchRate sets the catch rate of the PokemonForm.
func (*PokemonFormBuilder) CustomProperties ¶
func (b *PokemonFormBuilder) CustomProperties(props map[string]any) *PokemonFormBuilder
CustomProperties sets custom properties for the PokemonForm.
func (*PokemonFormBuilder) Description ¶
func (b *PokemonFormBuilder) Description(desc Translation) *PokemonFormBuilder
Description sets the description translations of the PokemonForm.
func (*PokemonFormBuilder) EvAtk ¶
func (b *PokemonFormBuilder) EvAtk(atk int32) *PokemonFormBuilder
EvAtk sets the EV yield for Attack of the PokemonForm.
func (*PokemonFormBuilder) EvAts ¶
func (b *PokemonFormBuilder) EvAts(ats int32) *PokemonFormBuilder
EvAts sets the EV yield for Special Attack of the PokemonForm.
func (*PokemonFormBuilder) EvDfe ¶
func (b *PokemonFormBuilder) EvDfe(dfe int32) *PokemonFormBuilder
EvDfe sets the EV yield for Defense of the PokemonForm.
func (*PokemonFormBuilder) EvDfs ¶
func (b *PokemonFormBuilder) EvDfs(dfs int32) *PokemonFormBuilder
EvDfs sets the EV yield for Special Defense of the PokemonForm.
func (*PokemonFormBuilder) EvHp ¶
func (b *PokemonFormBuilder) EvHp(hp int32) *PokemonFormBuilder
EvHp sets the EV yield for HP of the PokemonForm.
func (*PokemonFormBuilder) EvSpd ¶
func (b *PokemonFormBuilder) EvSpd(spd int32) *PokemonFormBuilder
EvSpd sets the EV yield for Speed of the PokemonForm.
func (*PokemonFormBuilder) Evolutions ¶
func (b *PokemonFormBuilder) Evolutions(evolutions []Evolution) *PokemonFormBuilder
Evolutions sets the evolutions of the PokemonForm.
func (*PokemonFormBuilder) ExperienceType ¶
func (b *PokemonFormBuilder) ExperienceType(expType string) *PokemonFormBuilder
ExperienceType sets the experience type of the PokemonForm.
func (*PokemonFormBuilder) FemaleRate ¶
func (b *PokemonFormBuilder) FemaleRate(rate float32) *PokemonFormBuilder
FemaleRate sets the female rate of the PokemonForm.
func (*PokemonFormBuilder) Form ¶
func (b *PokemonFormBuilder) Form(form int32) *PokemonFormBuilder
Form sets the form number of the PokemonForm.
func (*PokemonFormBuilder) FrontOffsetY ¶
func (b *PokemonFormBuilder) FrontOffsetY(y int32) *PokemonFormBuilder
FrontOffsetY sets the front offset Y of the PokemonForm.
func (*PokemonFormBuilder) HatchSteps ¶
func (b *PokemonFormBuilder) HatchSteps(steps int32) *PokemonFormBuilder
HatchSteps sets the hatch steps of the PokemonForm.
func (*PokemonFormBuilder) Height ¶
func (b *PokemonFormBuilder) Height(h float32) *PokemonFormBuilder
Height sets the height of the PokemonForm.
func (*PokemonFormBuilder) ItemHeld ¶
func (b *PokemonFormBuilder) ItemHeld(items []*ItemHeld) *PokemonFormBuilder
ItemHeld sets the items held by the PokemonForm.
func (*PokemonFormBuilder) Name ¶
func (b *PokemonFormBuilder) Name(name Translation) *PokemonFormBuilder
Name sets the name translations of the PokemonForm.
func (*PokemonFormBuilder) Resources ¶
func (b *PokemonFormBuilder) Resources(resources PokemonResources) *PokemonFormBuilder
Resources sets the resources of the PokemonForm.
func (*PokemonFormBuilder) Type1 ¶
func (b *PokemonFormBuilder) Type1(t *PokemonType) *PokemonFormBuilder
Type1 sets the primary type of the PokemonForm.
func (*PokemonFormBuilder) Type2 ¶
func (b *PokemonFormBuilder) Type2(t *PokemonType) *PokemonFormBuilder
Type2 sets the secondary type of the PokemonForm.
func (*PokemonFormBuilder) Weight ¶
func (b *PokemonFormBuilder) Weight(w float32) *PokemonFormBuilder
Weight sets the weight of the PokemonForm.
type PokemonMapper ¶
type PokemonMapper struct {
// contains filtered or unexported fields
}
PokemonMapper maps Pokemon descriptors to Pokemon entities.
func NewPokemonMapper ¶
func NewPokemonMapper(store *Store) *PokemonMapper
NewPokemonMapper creates a new PokemonMapper.
func (*PokemonMapper) MapBreedGroups ¶
func (m *PokemonMapper) MapBreedGroups(breedGroupInts []int32) []string
MapBreedGroups maps breed group descriptors to breed group strings.
func (*PokemonMapper) MapConditions ¶
func (m *PokemonMapper) MapConditions(conditions []ConditionDescriptor) []Condition
MapConditions maps condition descriptors to conditions.
func (*PokemonMapper) MapEvolutions ¶
func (m *PokemonMapper) MapEvolutions(evolutions []EvolutionDescriptor) []Evolution
MapEvolutions maps evolution descriptors to evolutions.
func (*PokemonMapper) MapFormDescriptorToPokemonForm ¶
func (m *PokemonMapper) MapFormDescriptorToPokemonForm(desc FormDescriptor) *PokemonForm
MapFormDescriptorToPokemonForm maps a FormDescriptor to a PokemonForm.
func (*PokemonMapper) MapItemHelds ¶
func (m *PokemonMapper) MapItemHelds(itemHelds []ItemHeldDescriptor) []*ItemHeld
MapItemHelds maps item held descriptors to item held entities.
func (*PokemonMapper) MapPokemonDescriptorToPokemon ¶
func (m *PokemonMapper) MapPokemonDescriptorToPokemon(desc PokemonDescriptor) *Pokemon
MapPokemonDescriptorToPokemon maps a PokemonDescriptor to a Pokemon.
func (*PokemonMapper) MapPokemonResources ¶
func (m *PokemonMapper) MapPokemonResources(resources PokemonResourcesDescriptor) PokemonResources
MapPokemonResources maps Pokemon resources descriptors to Pokemon resources.
type PokemonResources ¶
type PokemonResources struct {
Icon string
IconF string
IconShiny string
IconShinyF string
Front string
FrontF string
FrontShiny string
FrontShinyF string
Back string
BackF string
BackShiny string
BackShinyF string
Footprint string
Character string
CharacterF string
CharacterShiny string
CharacterShinyF string
Cry string
HasFemale bool
Egg string
IconEgg string
}
PokemonResources represents resources for a Pokemon form.
type PokemonResourcesDescriptor ¶
type PokemonResourcesDescriptor struct {
Icon string `json:"icon"`
IconF string `json:"iconF"`
IconShiny string `json:"iconShiny"`
IconShinyF string `json:"iconShinyF"`
Front string `json:"front"`
FrontF string `json:"frontF"`
FrontShiny string `json:"frontShiny"`
FrontShinyF string `json:"frontShinyF"`
Back string `json:"back"`
BackF string `json:"backF"`
BackShiny string `json:"backShiny"`
BackShinyF string `json:"backShinyF"`
Footprint string `json:"footprint"`
Character string `json:"character"`
CharacterF string `json:"characterF"`
CharacterShiny string `json:"characterShiny"`
CharacterShinyF string `json:"characterShinyF"`
Cry string `json:"cry"`
HasFemale bool `json:"hasFemale"`
Egg string `json:"egg"`
IconEgg string `json:"iconEgg"`
}
PokemonResourcesDescriptor is the JSON descriptor for Pokemon resources.
type PokemonType ¶
type PokemonType struct {
// contains filtered or unexported fields
}
PokemonType represents a Pokemon type (e.g., Fire, Water, Grass).
func (*PokemonType) Color ¶
func (t *PokemonType) Color() string
Color returns the color of the PokemonType.
func (*PokemonType) Damage ¶
func (t *PokemonType) Damage(defType string) (float32, bool)
Damage returns the type damage relation for a defending type.
func (*PokemonType) DamageTo ¶
func (t *PokemonType) DamageTo() iter.Seq2[string, float32]
DamageTo returns an iterator over the type damage relations.
func (*PokemonType) DamageToTypes ¶
func (t *PokemonType) DamageToTypes(type1, type2 string) float32
DamageToTypes calculates the overall damage factor when attacking a Pokemon with the given types.
func (*PokemonType) DbSymbol ¶
func (t *PokemonType) DbSymbol() string
DbSymbol returns the database symbol of the PokemonType.
func (*PokemonType) Name ¶
func (t *PokemonType) Name(lang string) string
Name returns the localized name of the PokemonType for the given language.
func (*PokemonType) TextId ¶
func (t *PokemonType) TextId() int
TextId returns the text ID of the PokemonType.
type PokemonTypeDescriptor ¶
type PokemonTypeDescriptor struct {
DbSymbol string `json:"dbSymbol"`
Color string `json:"color"`
TextId int `json:"textId"`
DamageTo []TypeDamageDescriptor `json:"damageTo"`
Name Translation
}
PokemonTypeDescriptor is the JSON descriptor for a Pokemon type.
func UnmarshalTypeDescriptor ¶
func UnmarshalTypeDescriptor(typeContent []byte) (*PokemonTypeDescriptor, error)
UnmarshalTypeDescriptor unmarshal a json encoded type to a descriptor typeContent the encoded type
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an in-memory store for a studio project
func (*Store) AddAbility ¶
func (*Store) AddPokemon ¶
func (*Store) AddType ¶
func (s *Store) AddType(pokemonType PokemonType) *PokemonType
func (*Store) FindAbilityBySymbol ¶
func (*Store) FindAllAbilities ¶
func (*Store) FindAllMoves ¶
func (*Store) FindAllPokemon ¶
func (*Store) FindAllTypes ¶
func (s *Store) FindAllTypes(filters ...iter2.FilterFunc[PokemonType]) iter.Seq[PokemonType]
func (*Store) FindMoveBySymbol ¶
func (*Store) FindPokemonByName ¶
func (*Store) FindPokemonBySymbol ¶
func (*Store) FindTypeBySymbol ¶
func (s *Store) FindTypeBySymbol(symbol string, filters ...iter2.FilterFunc[PokemonType]) *PokemonType
func (*Store) Resistances ¶
func (s *Store) Resistances(type1, type2 string, filters ...iter2.FilterFunc[PokemonType]) iter.Seq2[string, float32]
Resistances calculates the type resistances of the PokemonForm based on its types.
type Translation ¶
Translation is a map of language codes to translated strings.
func ImportTranslations ¶
func ImportTranslations(path string) ([]Translation, error)
ImportTranslations import translations from file path the path of the file to import
func ImportTranslationsOrEmpty ¶
func ImportTranslationsOrEmpty(path string) []Translation
ImportTranslationsOrEmpty import translations from file, if it fails log the error and return an empty list
func MapTranslation ¶
func MapTranslation(textId int, translations []Translation) Translation
type TypeBuilder ¶
type TypeBuilder struct {
// contains filtered or unexported fields
}
TypeBuilder builds PokemonType entities.
func (*TypeBuilder) Build ¶
func (b *TypeBuilder) Build() *PokemonType
Build returns a copy of the built PokemonType.
func (*TypeBuilder) Color ¶
func (b *TypeBuilder) Color(color string) *TypeBuilder
Color sets the color of the PokemonType.
func (*TypeBuilder) DamageTo ¶
func (b *TypeBuilder) DamageTo(damageTo map[string]float32) *TypeBuilder
DamageTo sets the damage relations of the PokemonType.
func (*TypeBuilder) DbSymbol ¶
func (b *TypeBuilder) DbSymbol(dbSymbol string) *TypeBuilder
DbSymbol sets the database symbol of the PokemonType.
func (*TypeBuilder) Name ¶
func (b *TypeBuilder) Name(name Translation) *TypeBuilder
Name sets the name translations of the PokemonType.
func (*TypeBuilder) TextId ¶
func (b *TypeBuilder) TextId(id int) *TypeBuilder
TextId sets the text ID of the PokemonType.
type TypeDamageDescriptor ¶
type TypeDamageDescriptor struct {
DefensiveType string `json:"defensiveType"`
Factor float32 `json:"factor"`
}
TypeDamageDescriptor is the JSON descriptor for a type damage relation.
type TypeMapper ¶
type TypeMapper struct {
// contains filtered or unexported fields
}
TypeMapper maps Type descriptors to PokemonType entities.
func NewTypeMapper ¶
func NewTypeMapper(store *Store) *TypeMapper
NewTypeMapper creates a new TypeMapper.
func (*TypeMapper) MapPokemonTypeDescriptorToPokemonType ¶
func (m *TypeMapper) MapPokemonTypeDescriptorToPokemonType(desc PokemonTypeDescriptor) *PokemonType
MapPokemonTypeDescriptorToPokemonType maps a PokemonTypeDescriptor to a PokemonType.
func (*TypeMapper) MapTypeDamages ¶
func (m *TypeMapper) MapTypeDamages(damages []TypeDamageDescriptor) map[string]float32
MapTypeDamages maps type damage descriptors to type damage entities.