Documentation ¶
Index ¶
- Variables
- func CleanJSON(jsonStr string) string
- func ConditionWithOperator(input string, operator string, langs *map[string]LangDict, ...) bool
- func DeleteDamageFormatter(input string) string
- func DeleteReplacer(input string) string
- func ElementFromCode(codeUndef string) int
- func LoadPersistedElements(persistenceDir string, release string) error
- func Max(a, b int) int
- func Min(a, b int) int
- func NumSpellFormatter(input string, lang string, gameData *JSONGameData, langs *map[string]LangDict, ...) (string, int)
- func ParseCondition(condition string, langs *map[string]LangDict, data *JSONGameData) ([]MappedMultilangCondition, *ConditionTreeNodeMapped)
- func ParseEffects(data *JSONGameData, allEffects [][]*JSONGameItemPossibleEffect, ...) [][]MappedMultilangEffect
- func ParseItemCombo(rawEffects [][]*JSONGameItemPossibleEffect, effects [][]MappedMultilangEffect) [][]MappedMultilangSetEffect
- func ParseRawDataPart[T HasId](fileSource string, result chan map[int]T, dir string)
- func ParseRawLanguages(dir string) map[string]LangDict
- func ParseSigness(input string) (bool, bool)
- func PersistElements(elementPath string, itemTypePath string) error
- func PrepareAndCreateRangeRegex(input string, extract bool) (string, *regexp.Regexp)
- func PrepareTextForRegex(input string) string
- func PrintTree(node *ConditionTreeNode, level int)
- func SingularPluralFormatter(input string, amount int, lang string) string
- type ConditionTreeNode
- type ConditionTreeNodeMapped
- type HasId
- type JSONGameAlamanaxCalendar
- type JSONGameArea
- type JSONGameAreaBounds
- type JSONGameBonus
- type JSONGameBreed
- type JSONGameCoordinate
- type JSONGameData
- type JSONGameEffect
- type JSONGameItem
- type JSONGameItemPossibleEffect
- type JSONGameItemType
- type JSONGameMount
- type JSONGameMountFamily
- type JSONGameNPC
- type JSONGameQuest
- type JSONGameQuestCategory
- type JSONGameQuestObjective
- type JSONGameQuestParameter
- type JSONGameQuestStep
- type JSONGameQuestStepRewards
- type JSONGameRecipe
- type JSONGameSet
- type JSONGameSpell
- type JSONGameSpellType
- type JSONGameTitle
- type JSONLangDict
- type LangDict
- type MappedMultilangCharacteristic
- type MappedMultilangCondition
- type MappedMultilangEffect
- type MappedMultilangItem
- type MappedMultilangItemType
- type MappedMultilangMount
- type MappedMultilangNPCAlmanax
- type MappedMultilangRecipe
- type MappedMultilangRecipeEntry
- type MappedMultilangSet
- type MappedMultilangSetEffect
- type MappedMultilangSetReverseLink
- type NodeType
- type PersistentStringKeysMap
Constants ¶
This section is empty.
Variables ¶
View Source
var Languages = []string{"fr", "en", "de", "es", "it", "pt"}
Functions ¶
func ConditionWithOperator ¶
func ConditionWithOperator(input string, operator string, langs *map[string]LangDict, out *MappedMultilangCondition, data *JSONGameData) bool
func DeleteDamageFormatter ¶
func DeleteReplacer ¶
func ElementFromCode ¶
func LoadPersistedElements ¶
func NumSpellFormatter ¶
func NumSpellFormatter(input string, lang string, gameData *JSONGameData, langs *map[string]LangDict, diceNum *int, diceSide *int, value *int, effectNameId int, numIsSpell bool, useDice bool, frNumSigned *int, frSideSigned *int) (string, int)
NumSpellFormatter returns info about min max with in. -1 "only_min", -2 "no_min_max"
func ParseCondition ¶
func ParseCondition(condition string, langs *map[string]LangDict, data *JSONGameData) ([]MappedMultilangCondition, *ConditionTreeNodeMapped)
func ParseEffects ¶
func ParseEffects(data *JSONGameData, allEffects [][]*JSONGameItemPossibleEffect, langs *map[string]LangDict) [][]MappedMultilangEffect
func ParseItemCombo ¶ added in v0.2.1
func ParseItemCombo(rawEffects [][]*JSONGameItemPossibleEffect, effects [][]MappedMultilangEffect) [][]MappedMultilangSetEffect
func ParseRawDataPart ¶
func ParseRawLanguages ¶
func ParseSigness ¶
func PersistElements ¶
func PrepareTextForRegex ¶
func PrintTree ¶ added in v0.1.1
func PrintTree(node *ConditionTreeNode, level int)
Types ¶
type ConditionTreeNode ¶ added in v0.1.1
type ConditionTreeNode struct { Value string Type NodeType Children []*ConditionTreeNode }
func ParseExpression ¶ added in v0.1.1
func ParseExpression(exp string) *ConditionTreeNode
func (*ConditionTreeNode) AddChild ¶ added in v0.1.1
func (n *ConditionTreeNode) AddChild(child *ConditionTreeNode)
AddChild adds a child node
type ConditionTreeNodeMapped ¶ added in v0.1.1
type ConditionTreeNodeMapped struct { Value *MappedMultilangCondition `json:"value"` IsOperand bool `json:"is_operand"` Relation *string `json:"relation"` // "and" or "or" Children []*ConditionTreeNodeMapped `json:"children"` }
type JSONGameAlamanaxCalendar ¶ added in v0.2.0
type JSONGameAlamanaxCalendar struct { Id int `json:"id"` DescId int `json:"descId"` NameId int `json:"nameId"` NpcId int `json:"npcId"` BonusesIds []int `json:"bonusesIds"` }
func (JSONGameAlamanaxCalendar) GetID ¶ added in v0.2.0
func (i JSONGameAlamanaxCalendar) GetID() int
type JSONGameArea ¶
type JSONGameArea struct { Id int `json:"id"` NameId int `json:"nameId"` SuperAreaId int `json:"superAreaId"` ContainHouses bool `json:"containHouses"` ContainPaddocks bool `json:"containPaddocks"` Bounds JSONGameAreaBounds `json:"bounds"` WorldmapId int `json:"worldmapId"` HasWorldMap bool `json:"hasWorldMap"` }
func (JSONGameArea) GetID ¶
func (i JSONGameArea) GetID() int
type JSONGameAreaBounds ¶
type JSONGameBonus ¶
type JSONGameBonus struct { Amount int `json:"amount"` Id int `json:"id"` CriterionsIds []int `json:"criterionsIds"` Type int `json:"type"` }
func (JSONGameBonus) GetID ¶
func (i JSONGameBonus) GetID() int
type JSONGameBreed ¶
type JSONGameBreed struct { Id int `json:"id"` ShortNameId int `json:"shortNameId"` LongNameId int `json:"longNameId"` DescriptionId int `json:"descriptionId"` }
func (JSONGameBreed) GetID ¶
func (i JSONGameBreed) GetID() int
type JSONGameCoordinate ¶ added in v0.2.0
type JSONGameData ¶
type JSONGameData struct { Items map[int]JSONGameItem Sets map[int]JSONGameSet ItemTypes map[int]JSONGameItemType Recipes map[int]JSONGameRecipe Mounts map[int]JSONGameMount MountFamilys map[int]JSONGameMountFamily // contains filtered or unexported fields }
func ParseRawData ¶
func ParseRawData(dir string) *JSONGameData
type JSONGameEffect ¶
type JSONGameEffect struct { Id int `json:"id"` DescriptionId int `json:"descriptionId"` IconId int `json:"iconId"` Characteristic int `json:"characteristic"` Category int `json:"category"` UseDice bool `json:"useDice"` Active bool `json:"active"` TheoreticalDescriptionId int `json:"theoreticalDescriptionId"` BonusType int `json:"bonusType"` // -1,0,+1 ElementId int `json:"elementId"` UseInFight bool `json:"useInFight"` }
func (JSONGameEffect) GetID ¶
func (i JSONGameEffect) GetID() int
type JSONGameItem ¶
type JSONGameItem struct { Id int `json:"id"` TypeId int `json:"typeId"` DescriptionId int `json:"descriptionId"` IconId int `json:"iconId"` NameId int `json:"nameId"` Level int `json:"level"` PossibleEffects []*JSONGameItemPossibleEffect `json:"possibleEffects"` RecipeIds []int `json:"recipeIds"` Pods int `json:"realWeight"` ParseEffects bool `json:"useDice"` EvolutiveEffectIds []int `json:"evolutiveEffectIds"` DropMonsterIds []int `json:"dropMonsterIds"` ItemSetId int `json:"itemSetId"` Criteria string `json:"criteria"` CriticalHitBonus int `json:"criticalHitBonus"` TwoHanded bool `json:"twoHanded"` MaxCastPerTurn int `json:"maxCastPerTurn"` ApCost int `json:"apCost"` Range int `json:"range"` MinRange int `json:"minRange"` CriticalHitProbability int `json:"criticalHitProbability"` }
func (JSONGameItem) GetID ¶
func (i JSONGameItem) GetID() int
type JSONGameItemPossibleEffect ¶
type JSONGameItemPossibleEffect struct { EffectId int `json:"effectId"` MinimumValue int `json:"diceNum"` MaximumValue int `json:"diceSide"` Value int `json:"value"` BaseEffectId int `json:"baseEffectId"` EffectElement int `json:"effectElement"` Dispellable int `json:"dispellable"` SpellId int `json:"spellId"` Duration int `json:"duration"` }
func (JSONGameItemPossibleEffect) GetID ¶
func (i JSONGameItemPossibleEffect) GetID() int
type JSONGameItemType ¶
type JSONGameItemType struct { Id int `json:"id"` NameId int `json:"nameId"` SuperTypeId int `json:"superTypeId"` CategoryId int `json:"categoryId"` }
func (JSONGameItemType) GetID ¶
func (i JSONGameItemType) GetID() int
type JSONGameMount ¶
type JSONGameMount struct { Id int `json:"id"` FamilyId int `json:"familyId"` NameId int `json:"nameId"` Effects []*JSONGameItemPossibleEffect `json:"effects"` }
func (JSONGameMount) GetID ¶
func (i JSONGameMount) GetID() int
type JSONGameMountFamily ¶
type JSONGameMountFamily struct { Id int `json:"id"` NameId int `json:"nameId"` HeadUri string `json:"headUri"` }
func (JSONGameMountFamily) GetID ¶
func (i JSONGameMountFamily) GetID() int
type JSONGameNPC ¶
type JSONGameNPC struct { Id int `json:"id"` NameId int `json:"nameId"` DialogMessages [][]int `json:"dialogMessages"` DialogReplies [][]int `json:"dialogReplies"` Actions []int `json:"actions"` }
func (JSONGameNPC) GetID ¶
func (i JSONGameNPC) GetID() int
type JSONGameQuest ¶ added in v0.2.0
type JSONGameQuest struct { Id int `json:"id"` NameId int `json:"nameId"` StepIds []int `json:"stepIds"` CategoryId int `json:"categoryId"` RepeatType int `json:"repeatType"` RepeatLimit int `json:"repeatLimit"` IsDungeonQuest bool `json:"isDungeonQuest"` LevelMin int `json:"levelMin"` LevelMax int `json:"levelMax"` Followable bool `json:"followable"` IsPartyQuest bool `json:"isPartyQuest"` StartCriterion string `json:"startCriterion"` }
func (JSONGameQuest) GetID ¶ added in v0.2.0
func (i JSONGameQuest) GetID() int
type JSONGameQuestCategory ¶ added in v0.2.0
type JSONGameQuestCategory struct { Id int `json:"id"` NameId int `json:"nameId"` Order int `json:"order"` QuestIds []int `json:"questIds"` }
func (JSONGameQuestCategory) GetID ¶ added in v0.2.0
func (i JSONGameQuestCategory) GetID() int
type JSONGameQuestObjective ¶ added in v0.2.0
type JSONGameQuestObjective struct { Id int `json:"id"` Coords JSONGameCoordinate `json:"coords"` MapId int `json:"mapId"` Parameters JSONGameQuestParameter `json:"parameters"` StepId int `json:"stepId"` TypeId int `json:"typeId"` }
func (JSONGameQuestObjective) GetID ¶ added in v0.2.0
func (i JSONGameQuestObjective) GetID() int
type JSONGameQuestParameter ¶ added in v0.2.0
type JSONGameQuestStep ¶ added in v0.2.0
type JSONGameQuestStep struct { Id int `json:"id"` DescriptionId int `json:"descriptionId"` DialogId int `json:"dialogId"` NameId int `json:"nameId"` OptimalLevel int `json:"optimalLevel"` Duration float64 `json:"duration"` ObjectiveIds []int `json:"objectiveIds"` RewardsIds []int `json:"rewardsIds"` QuestId int `json:"questId"` }
func (JSONGameQuestStep) GetID ¶ added in v0.2.0
func (i JSONGameQuestStep) GetID() int
type JSONGameQuestStepRewards ¶ added in v0.2.0
type JSONGameQuestStepRewards struct { Id int `json:"id"` ExperienceRatio float64 `json:"experienceRatio"` KamasRatio float64 `json:"kamasRatio"` ItemsReward [][]int `json:"itemsReward"` KamasScaleWithPlayerLevel bool `json:"kamasScaleWithPlayerLevel"` LevelMax int `json:"levelMax"` LevelMin int `json:"levelMin"` //SpellsReward []int `json:"spellsReward"` //EmotesReward []int `json:"emotesReward"` //TitlesReward []int `json:"titlesReward"` StepId int `json:"stepId"` }
func (JSONGameQuestStepRewards) GetID ¶ added in v0.2.0
func (i JSONGameQuestStepRewards) GetID() int
type JSONGameRecipe ¶
type JSONGameRecipe struct { Id int `json:"resultId"` NameId int `json:"resultNameId"` TypeId int `json:"resultTypeId"` Level int `json:"resultLevel"` IngredientIds []int `json:"ingredientIds"` Quantities []int `json:"quantities"` JobId int `json:"jobId"` SkillId int `json:"skillId"` }
func (JSONGameRecipe) GetID ¶
func (i JSONGameRecipe) GetID() int
type JSONGameSet ¶
type JSONGameSet struct { Id int `json:"id"` ItemIds []int `json:"items"` NameId int `json:"nameId"` Effects [][]*JSONGameItemPossibleEffect `json:"effects"` }
func (JSONGameSet) GetID ¶
func (i JSONGameSet) GetID() int
type JSONGameSpell ¶
type JSONGameSpell struct { Id int `json:"id"` NameId int `json:"nameId"` DescriptionId int `json:"descriptionId"` TypeId int `json:"typeId"` Order int `json:"order"` IconId int `json:"iconId"` SpellLevels []int `json:"spellLevels"` }
func (JSONGameSpell) GetID ¶
func (i JSONGameSpell) GetID() int
type JSONGameSpellType ¶
type JSONGameSpellType struct { Id int `json:"id"` LongNameId int `json:"longNameId"` ShortNameId int `json:"shortNameId"` }
func (JSONGameSpellType) GetID ¶
func (i JSONGameSpellType) GetID() int
type JSONGameTitle ¶ added in v0.1.4
type JSONGameTitle struct { Id int `json:"id"` NameMaleId int `json:"nameMaleId"` NameFemaleId int `json:"nameFemaleId"` Visible bool `json:"visible"` CategoryId int `json:"categoryId"` }
func (JSONGameTitle) GetID ¶ added in v0.1.4
func (i JSONGameTitle) GetID() int
type JSONLangDict ¶
type LangDict ¶
func ParseLangDict ¶
type MappedMultilangEffect ¶
type MappedMultilangEffect struct { Min int `json:"min"` Max int `json:"max"` Type map[string]string `json:"type"` MinMaxIrrelevant int `json:"min_max_irrelevant"` Templated map[string]string `json:"templated"` ElementId int `json:"element_id"` IsMeta bool `json:"is_meta"` Active bool `json:"active"` }
type MappedMultilangItem ¶
type MappedMultilangItem struct { AnkamaId int `json:"ankama_id"` Type MappedMultilangItemType `json:"type"` Description map[string]string `json:"description"` Name map[string]string `json:"name"` Image string `json:"image"` Conditions []MappedMultilangCondition `json:"conditions"` ConditionTree *ConditionTreeNodeMapped `json:"condition_tree"` Level int `json:"level"` UsedInRecipes []int `json:"used_in_recipes"` Characteristics []MappedMultilangCharacteristic `json:"characteristics"` Effects []MappedMultilangEffect `json:"effects"` DropMonsterIds []int `json:"dropMonsterIds"` CriticalHitBonus int `json:"criticalHitBonus"` TwoHanded bool `json:"twoHanded"` MaxCastPerTurn int `json:"maxCastPerTurn"` ApCost int `json:"apCost"` Range int `json:"range"` MinRange int `json:"minRange"` CriticalHitProbability int `json:"criticalHitProbability"` Pods int `json:"pods"` IconId int `json:"iconId"` ParentSet MappedMultilangSetReverseLink `json:"parentSet"` HasParentSet bool `json:"hasParentSet"` }
func MapItems ¶
func MapItems(data *JSONGameData, langs *map[string]LangDict) []MappedMultilangItem
type MappedMultilangItemType ¶
type MappedMultilangMount ¶
type MappedMultilangMount struct { AnkamaId int `json:"ankama_id"` Name map[string]string `json:"name"` FamilyId int `json:"family_id"` FamilyName map[string]string `json:"family_name"` Effects []MappedMultilangEffect `json:"effects"` }
func MapMounts ¶
func MapMounts(data *JSONGameData, langs *map[string]LangDict) []MappedMultilangMount
type MappedMultilangNPCAlmanax ¶ added in v0.2.0
type MappedMultilangNPCAlmanax struct { OfferingReceiver string `json:"offeringReceiver"` Days []string `json:"days"` Offering struct { ItemId int `json:"itemId"` ItemName map[string]string `json:"itemName"` Quantity int `json:"quantity"` ImageUrls struct { HD string `json:"hd"` HQ string `json:"hq"` SD string `json:"sd"` Icon string `json:"icon"` } } Bonus map[string]string `json:"bonus"` BonusType map[string]string `json:"bonusType"` RewardKamas int `json:"rewardKamas"` }
func MapAlmanax ¶ added in v0.2.0
func MapAlmanax(data *JSONGameData, langs *map[string]LangDict) []MappedMultilangNPCAlmanax
type MappedMultilangRecipe ¶
type MappedMultilangRecipe struct { ResultId int `json:"result_id"` Entries []MappedMultilangRecipeEntry `json:"entries"` }
func MapRecipes ¶
func MapRecipes(data *JSONGameData) []MappedMultilangRecipe
type MappedMultilangSet ¶
type MappedMultilangSet struct { AnkamaId int `json:"ankama_id"` Name map[string]string `json:"name"` ItemIds []int `json:"items"` Effects [][]MappedMultilangSetEffect `json:"effects"` Level int `json:"level"` }
func MapSets ¶
func MapSets(data *JSONGameData, langs *map[string]LangDict) []MappedMultilangSet
type MappedMultilangSetEffect ¶ added in v0.2.1
type MappedMultilangSetEffect struct { Min int `json:"min"` Max int `json:"max"` Type map[string]string `json:"type"` MinMaxIrrelevant int `json:"min_max_irrelevant"` Templated map[string]string `json:"templated"` ElementId int `json:"element_id"` IsMeta bool `json:"is_meta"` Active bool `json:"active"` ItemCombination uint `json:"item_combination"` }
type NodeType ¶ added in v0.1.1
type NodeType int
NodeType defines the type of a node - either an operator or an operand
type PersistentStringKeysMap ¶
type PersistentStringKeysMap struct { Entries *treebidimap.Map `json:"entries"` NextId int `json:"next_id"` }
var ( PersistedElements PersistentStringKeysMap PersistedTypes PersistentStringKeysMap )
Click to show internal directories.
Click to hide internal directories.