Documentation ¶
Overview ¶
GENERATED BY popgen DO NOT EDIT
Index ¶
- type AbilityScoreChoiceWrapper
- type ArmorClassJSON
- type ArmorJSON
- type BaseRaceJSON
- type BonusOptionWrapper
- type BonusWrapper
- type ChoiceWrapper
- type ClassJSON
- type ClassPopulator
- type DamageJSON
- type EquipmentBaseJSON
- type EquipmentJSON
- type EquipmentPopulator
- type EquipmentWrapper
- type GearJSON
- type IndxWrapper
- type OptionWrapper
- type Popper
- func (p *Popper) GetIDsFromIndxWrapperString(v []byte) []int
- func (p *Popper) GetIDsFromIndxWrappers(indxs []IndxWrapper) []int
- func (p *Popper) PopulateAbilityScore(ctx context.Context) ([]*ent.AbilityScore, error)
- func (p *Popper) PopulateAlignment(ctx context.Context) ([]*ent.Alignment, error)
- func (p *Popper) PopulateAll(ctx context.Context) error
- func (p *Popper) PopulateCoin(ctx context.Context) ([]*ent.Coin, error)
- func (p *Popper) PopulateCondition(ctx context.Context) ([]*ent.Condition, error)
- func (p *Popper) PopulateCustom(ctx context.Context) error
- func (p *Popper) PopulateDamageType(ctx context.Context) ([]*ent.DamageType, error)
- func (p *Popper) PopulateFeat(ctx context.Context) ([]*ent.Feat, error)
- func (p *Popper) PopulateFeature(ctx context.Context) ([]*ent.Feature, error)
- func (p *Popper) PopulateFeatureEdges(ctx context.Context) error
- func (p *Popper) PopulateLanguage(ctx context.Context) ([]*ent.Language, error)
- func (p *Popper) PopulateMagicSchool(ctx context.Context) ([]*ent.MagicSchool, error)
- func (p *Popper) PopulateProperty(ctx context.Context) ([]*ent.Property, error)
- func (p *Popper) PopulateRule(ctx context.Context) ([]*ent.Rule, error)
- func (p *Popper) PopulateRuleEdges(ctx context.Context) error
- func (p *Popper) PopulateRuleSection(ctx context.Context) ([]*ent.RuleSection, error)
- func (p *Popper) PopulateSkill(ctx context.Context) ([]*ent.Skill, error)
- func (p *Popper) PopulateSkillEdges(ctx context.Context) error
- func (p *Popper) PopulateTrait(ctx context.Context) ([]*ent.Trait, error)
- type Populator
- type ProficiencyJSON
- type ProficiencyPopulator
- type QuantityItemWrapper
- type QuantityUnitWrapper
- type RaceJSON
- type RacePopulator
- type RangeJSON
- type RefWrapper
- type SubraceJSON
- type ToolJSON
- type VehicleJSON
- type WeaponJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbilityScoreChoiceWrapper ¶
type AbilityScoreChoiceWrapper struct { Desc []string `json:"desc"` Choose int `json:"choose"` Type string `json:"type"` From struct { OptionSetType string `json:"option_set_type"` Options []BonusOptionWrapper `json:"options"` } `json:"from"` }
type ArmorClassJSON ¶
type ArmorJSON ¶
type ArmorJSON struct { ArmorCategory string `json:"armor_category"` ArmorClass ArmorClassJSON `json:"armor_class"` StrMinimum int `json:"str_minimum"` StealthDis bool `json:"stealth_disadvantage"` }
type BaseRaceJSON ¶
type BaseRaceJSON struct { Indx string `json:"index"` Name string `json:"name"` Speed int `json:"speed"` Size string `json:"size"` AlignmentDesc string `json:"alignment"` AgeDesc string `json:"age"` SizeDesc string `json:"size_description"` LanguageDesc string `json:"language_desc"` StartingProficiencies []IndxWrapper `json:"proficiencies"` StartingProficiencyOptions ChoiceWrapper `json:"starting_proficiency_options"` AbilityBonuses []BonusWrapper `json:"ability_bonuses"` AbilityBonusOptions AbilityScoreChoiceWrapper `json:"ability_bonus_options"` Traits []IndxWrapper `json:"traits"` Languages []IndxWrapper `json:"languages"` LanguageOptions ChoiceWrapper `json:"language_options"` }
type BonusOptionWrapper ¶
type BonusOptionWrapper struct { OptionType string `json:"option_type"` AbilityScore IndxWrapper `json:"ability_score"` Bonus int `json:"bonus"` }
type BonusWrapper ¶
type BonusWrapper struct { AbilityScore IndxWrapper `json:"ability_score"` Bonus int `json:"bonus"` }
type ChoiceWrapper ¶
type ChoiceWrapper struct { Desc []string `json:"desc"` Choose int `json:"choose"` FromType string `json:"type"` From struct { OptionSetType string `json:"option_set_type"` Options []OptionWrapper `json:"options"` } `json:"from"` }
type ClassJSON ¶
type ClassJSON struct { Indx string `json:"index"` Name string `json:"name"` HitDie int `json:"hit_die"` Proficiencies []IndxWrapper `json:"proficiencies"` ProficiencyChoices []ChoiceWrapper `json:"proficiency_choices"` StartingEquipment []EquipmentWrapper `json:"starting_equipment"` SavingThrows []IndxWrapper `json:"saving_throws"` }
type ClassPopulator ¶
type ClassPopulator struct {
// contains filtered or unexported fields
}
func NewClassPopulator ¶
func NewClassPopulator(pp *Popper) *ClassPopulator
type DamageJSON ¶
type DamageJSON struct { DamageDice string `json:"damage_dice"` DamageType IndxWrapper `json:"damage_type"` }
type EquipmentBaseJSON ¶
type EquipmentBaseJSON struct { Indx string `json:"index"` Name string `json:"name"` Desc []string `json:"desc,omitempty"` Weight float64 `json:"weight,omitempty"` Cost QuantityUnitWrapper `json:"cost,omitempty"` EquipmentCategory IndxWrapper `json:"equipment_category"` }
type EquipmentJSON ¶
type EquipmentJSON struct { *EquipmentBaseJSON *WeaponJSON *ArmorJSON *GearJSON *ToolJSON *VehicleJSON }
type EquipmentPopulator ¶
type EquipmentPopulator struct {
// contains filtered or unexported fields
}
func NewEquipmentPopulator ¶
func NewEquipmentPopulator(pp *Popper) *EquipmentPopulator
type EquipmentWrapper ¶
type EquipmentWrapper struct { Equipment IndxWrapper `json:"equipment"` Quantity int `json:"quantity"` }
type GearJSON ¶
type GearJSON struct { GearCategory IndxWrapper `json:"gear_category,omitempty"` Contents []QuantityItemWrapper `json:"contents,omitempty"` }
type IndxWrapper ¶
type IndxWrapper struct {
Indx string `json:"index"`
}
type OptionWrapper ¶
type OptionWrapper struct { Item *IndxWrapper `json:"item"` Choice *ChoiceWrapper `json:"choice"` }
type Popper ¶
type Popper struct { Client *ent.Client DataDir string IdToIndx map[int]string IndxToId map[string]int }
Popper is a populator for the ent database.
func NewPopper ¶
NewPopper creates a new Popper configured to populate data from JSON files in the popper/data directory into a database via the given ent client.
func NewTestPopper ¶
NewTestPopper creates a new Popper for testing.
func (*Popper) GetIDsFromIndxWrapperString ¶
GetIDsFromIndxWrapperString gets the IDs from the given JSON string.
func (*Popper) GetIDsFromIndxWrappers ¶
func (p *Popper) GetIDsFromIndxWrappers(indxs []IndxWrapper) []int
GetIDsFromIndxWrappers gets the IDs from the given indx wrappers.
func (*Popper) PopulateAbilityScore ¶
PopulateAbilityScore populates the AbilityScore entities from the JSON data files.
func (*Popper) PopulateAlignment ¶
PopulateAlignment populates the Alignment entities from the JSON data files.
func (*Popper) PopulateAll ¶
PopulateAll populates all the entities from the JSON data files.
func (*Popper) PopulateCoin ¶
PopulateCoin populates the Coin entities from the JSON data files.
func (*Popper) PopulateCondition ¶
PopulateCondition populates the Condition entities from the JSON data files.
func (*Popper) PopulateCustom ¶
PopulateCustom populates custom entities.
func (*Popper) PopulateDamageType ¶
PopulateDamageType populates the DamageType entities from the JSON data files.
func (*Popper) PopulateFeat ¶
PopulateFeat populates the Feat entities from the JSON data files.
func (*Popper) PopulateFeature ¶
PopulateFeature populates the Feature entities from the JSON data files.
func (*Popper) PopulateFeatureEdges ¶
PopulateFeatureEdges populates the Feature edges.
func (*Popper) PopulateLanguage ¶
PopulateLanguage populates the Language entities from the JSON data files.
func (*Popper) PopulateMagicSchool ¶
PopulateMagicSchool populates the MagicSchool entities from the JSON data files.
func (*Popper) PopulateProperty ¶
PopulateProperty populates the Property entities from the JSON data files.
func (*Popper) PopulateRule ¶
PopulateRule populates the Rule entities from the JSON data files.
func (*Popper) PopulateRuleEdges ¶
PopulateRuleEdges populates the Rule edges.
func (*Popper) PopulateRuleSection ¶
PopulateRuleSection populates the RuleSection entities from the JSON data files.
func (*Popper) PopulateSkill ¶
PopulateSkill populates the Skill entities from the JSON data files.
func (*Popper) PopulateSkillEdges ¶
PopulateSkillEdges populates the Skill edges.
type ProficiencyJSON ¶
type ProficiencyJSON struct { Indx string `json:"index"` ProfType string `json:"type"` Name string `json:"name"` Classes []IndxWrapper `json:"classes"` Races []IndxWrapper `json:"races"` Reference RefWrapper `json:"reference"` }
type ProficiencyPopulator ¶
type ProficiencyPopulator struct {
// contains filtered or unexported fields
}
func NewProficiencyPopulator ¶
func NewProficiencyPopulator(pp *Popper, dataFile string) *ProficiencyPopulator
type QuantityItemWrapper ¶
type QuantityItemWrapper struct { Quantity int `json:"quantity"` Item IndxWrapper `json:"item"` }
type QuantityUnitWrapper ¶
type RaceJSON ¶
type RaceJSON struct {
*BaseRaceJSON
}
type RacePopulator ¶
type RacePopulator struct {
// contains filtered or unexported fields
}
func NewRacePopulator ¶
func NewRacePopulator(pp *Popper, dataFile string) *RacePopulator
type RefWrapper ¶
type SubraceJSON ¶
type SubraceJSON struct { Indx string `json:"index"` Name string `json:"name"` Desc []string `json:"desc"` AbilityBonuses []BonusWrapper `json:"ability_bonuses"` Proficiencies []IndxWrapper `json:"proficiencies"` Traits []IndxWrapper `json:"traits"` LanguageOptions ChoiceWrapper `json:"language_options"` Race IndxWrapper `json:"race"` }
type VehicleJSON ¶
type VehicleJSON struct { VehicleCategory string `json:"vehicle_category,omitempty"` Speed QuantityUnitWrapper `json:"speed,omitempty"` Capacity string `json:"capacity,omitempty"` }
type WeaponJSON ¶
type WeaponJSON struct { WeaponCategory string `json:"weapon_category"` WeaponRange string `json:"weapon_range"` CategoryRange string `json:"category_range"` Damage DamageJSON `json:"damage"` Range RangeJSON `json:"range,omitempty"` ThrowRange RangeJSON `json:"throw_range,omitempty"` WeaponProperties []IndxWrapper `json:"properties"` }