models

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ability

type Ability struct {
	GameID int64  `json:"gameID"`
	Type   string `json:"type"`
}

type Actor

type Actor struct {
	GameID   int64  `json:"gameID"`
	Name     string `json:"name"`
	PetOwner *int64 `json:"petOwner"`
	Type     string `json:"type"`
	SubType  string `json:"subType"`
}

type Analysis

type Analysis struct {
	Data map[int64]*PlayerAnalysis
	// contains filtered or unexported fields
}

func (*Analysis) FilterPlayers

func (a *Analysis) FilterPlayers(predicate func(*PlayerAnalysis) bool) []*PlayerAnalysis

func (*Analysis) GetPlayerAnalysis

func (a *Analysis) GetPlayerAnalysis(gameID int64) *PlayerAnalysis

func (*Analysis) MarshalJSON

func (a *Analysis) MarshalJSON() ([]byte, error)

func (*Analysis) SetPlayerAnalysis

func (a *Analysis) SetPlayerAnalysis(playerID int64, pa *PlayerAnalysis)

type Aura

type Aura struct {
	Source  int64      `json:"source"`
	Ability int64      `json:"ability"`
	Stacks  int64      `json:"stacks"`
	Icon    string     `json:"icon"`
	Name    string     `json:"name,omitempty"`
	Events  []struct{} `json:"events"`
}

type CastInFight

type CastInFight struct {
	CommonConfig

	SpellID          int64  `json:"spell_id"`
	Display          bool   `json:"display"`
	Name             string `json:"name"`
	Type             string `json:"type"`
	ItemID           int64  `json:"item_id"`
	CooldownID       string `json:"cooldown_id"`
	SuggestedSpellID int64  `json:"suggested_spell_id"`
}

type Class

type Class string
const (
	Class_Paladin Class = "Paladin"
	Class_Rogue   Class = "Rogue"
	Class_Warrior Class = "Warrior"
	Class_Shaman  Class = "Shaman"
	Class_Druid   Class = "Druid"
	Class_Priest  Class = "Priest"
	Class_Warlock Class = "Warlock"
	Class_Mage    Class = "Mage"
	Class_Hunter  Class = "Hunter"
	Class_Unknown Class = "Unknown"
)

type CommonConfig

type CommonConfig struct {
	Invalid                      bool     `json:"invalid,omitempty"`
	InvalidReason                string   `json:"invalid_reason,omitempty"`
	RestrictedRoles              []string `json:"restricted_roles,omitempty"`
	RestrictedSpecializations    []string `json:"restricted_specializations,omitempty"`
	RestrictedSpecializationsNot []string `json:"restricted_specializations_not,omitempty"`
	RestrictedFights             []string `json:"restricted_fights,omitempty"`
	RestrictedAny                []string `json:"restricted_any,omitempty"` // TODO:implement
	RestrictedClass              []string `json:"restricted_class,omitempty"`

	Todo string `json:"__todo,omitempty"`
}

func (CommonConfig) IsRestricted

func (cc CommonConfig) IsRestricted(ctx context.Context, fa *FightAnalysis) bool

type Consumable

type Consumable struct {
	CommonConfig

	ID          int64    `json:"id"`
	Name        string   `json:"name"`
	Types       []string `json:"types"`
	Description string   `json:"description"`
}

func (Consumable) Is

func (c Consumable) Is(consumableType string) bool

func (Consumable) IsBattleElixir

func (c Consumable) IsBattleElixir() bool

func (Consumable) IsFood

func (c Consumable) IsFood() bool

func (Consumable) IsGuardianElixir

func (c Consumable) IsGuardianElixir() bool

type Enchant

type Enchant struct {
	CommonConfig

	ID      int64  `json:"id"`
	Name    string `json:"name"`
	SpellID int64  `json:"spell_id"` // TODO:implement
}

type EnemyNPC

type EnemyNPC struct {
	GameID        int64 `json:"gameID"`
	ID            int64 `json:"id"`
	InstanceCount int64 `json:"instanceCount"`
	GroupCount    int64 `json:"groupCount"`
}

type Fight

type Fight struct {
	EncounterID     int64             `json:"encounterID"`
	StartTime       int64             `json:"startTime"`
	EndTime         int64             `json:"endTime"`
	Name            string            `json:"name"`
	EnemyNPCs       []EnemyNPC        `json:"enemyNPCs"`
	FriendlyPlayers []int64           `json:"friendlyPlayers"`
	FightPercentage float64           `json:"fightPercentage"`
	Kill            bool              `json:"kill"`
	InternalName    string            `json:"internalName"`
	Events          []json.RawMessage `json:"events"`
}

type FightAnalysis

type FightAnalysis struct {
	Name     string             `json:"name"`
	Auras    map[int64]*Aura    `json:"auras"`
	Remarks  []*remark.Remark   `json:"remarks"`
	Talents  *Talents           `json:"talents"`
	Casts    map[int64]int64    `json:"casts"`
	Gear     []*Gear            `json:"gear"`
	Analysis *TrueFightAnalysis `json:"analysis"`
	// contains filtered or unexported fields
}

func (*FightAnalysis) AddCast

func (fa *FightAnalysis) AddCast(ability, count int64)

func (*FightAnalysis) AddRemark

func (fa *FightAnalysis) AddRemark(metadata remark.Metadata)

func (*FightAnalysis) CouldBenefitFromWindfury

func (fa *FightAnalysis) CouldBenefitFromWindfury(analysis *Analysis) bool

type FightCast

type FightCast struct {
	SpellID int64 `json:"spell_id"`
	Count   int64 `json:"count"`
}

type Gear

type Gear struct {
	ID               int64      `json:"id"`
	Quality          int64      `json:"quality"`
	Icon             string     `json:"icon"`
	ItemLevel        int64      `json:"itemLevel"`
	PermanentEnchant *int64     `json:"permanentEnchant,omitempty"`
	TemporaryEnchant *int64     `json:"temporaryEnchant,omitempty"`
	Gems             []*GearGem `json:"gems,omitempty"`
	WowheadAttr      string     `json:"wowhead_attr"`
	UUID             string     `json:"uuid"`

	WowheadData *wowhead.Item `json:"-"`
}

func (*Gear) ComputeUUID

func (g *Gear) ComputeUUID()

func (*Gear) ComputeWowheadAttr

func (g *Gear) ComputeWowheadAttr()

func (Gear) CountGems

func (g Gear) CountGems(color string) int64

func (Gear) CountMissingGems

func (g Gear) CountMissingGems() int

func (Gear) GetGems

func (g Gear) GetGems(color string) []*GearGem

func (Gear) ShouldBeEnchanted

func (g Gear) ShouldBeEnchanted() bool

func (Gear) ShouldHaveTemporaryEnchant

func (g Gear) ShouldHaveTemporaryEnchant() bool

type GearGem

type GearGem struct {
	ID        int64  `json:"id"`
	ItemLevel int64  `json:"itemLevel"`
	Icon      string `json:"icon"`
	Color     string `json:"-"`
}

type Gem

type Gem struct {
	CommonConfig

	ID       int64            `json:"id"`
	Name     string           `json:"name"`
	Quality  int64            `json:"quality"`
	Color    string           `json:"color"`
	Requires *GemRequirements `json:"requires,omitempty"`
}

func (*Gem) IsRestricted

func (g *Gem) IsRestricted(ctx context.Context, fa *FightAnalysis) bool

type GemRequirements

type GemRequirements struct {
	Rule  string `json:"rule"`
	Count []struct {
		Color string `json:"color"`
		Value int64  `json:"value"`
	} `json:"count,omitempty"`
	X string `json:"x,omitempty"`
	Y string `json:"y,omitempty"`
}

type LogFight

type LogFight struct {
	StartTime int64  `json:"startTime"`
	EndTime   int64  `json:"endTime"`
	Name      string `json:"name"`
}

type Logs

type Logs struct {
	StartTime int64               `json:"startTime"`
	EndTime   int64               `json:"endTime"`
	Title     string              `json:"title"`
	Actors    []string            `json:"actors"`
	ZoneID    int64               `json:"zoneID"`
	Fights    map[string]LogFight `json:"fights"`
	Code      string              `json:"code"`
}

type MasterData

type MasterData struct {
	Lang      string     `json:"lang"`
	Abilities []*Ability `json:"abilities"`
	Actors    []*Actor   `json:"actors"`
}

type Player

type Player struct {
	Actor
}

type PlayerAnalysis

type PlayerAnalysis struct {
	Actor

	Fights  map[string]*FightAnalysis `json:"fights"`
	Remarks []*remark.Remark          `json:"remarks"`
	// contains filtered or unexported fields
}

func (*PlayerAnalysis) AggregateRemarks

func (pa *PlayerAnalysis) AggregateRemarks()

func (*PlayerAnalysis) GetFight

func (pa *PlayerAnalysis) GetFight(name string) *FightAnalysis

func (*PlayerAnalysis) SetFight

func (pa *PlayerAnalysis) SetFight(fa *FightAnalysis)

type Report

type Report struct {
	Code       string      `json:"code"`
	EndTime    int64       `json:"endTime"`
	StartTime  int64       `json:"startTime"`
	Title      string      `json:"title"`
	Zone       Zone        `json:"zone"`
	MasterData *MasterData `json:"masterData"`
	Fights     []*Fight    `json:"fights"`
}

type Role

type Role string
const (
	Role_Tank     Role = "Tank"
	Role_Heal     Role = "Heal"
	Role_Melee    Role = "Melee"
	Role_Ranged   Role = "Ranged"
	Role_Magic    Role = "Magic"
	Role_Physical Role = "Physical"
)

type Specialization

type Specialization string
const (
	Specialization_RetributionPaladin Specialization = "RetributionPaladin"
	Specialization_HolyPaladin        Specialization = "HolyPaladin"
	Specialization_ProtectionPaladin  Specialization = "ProtectionPaladin"
	Specialization_CombatRogue        Specialization = "CombatRogue"
	Specialization_AssassinationRogue Specialization = "AssassinationRogue"
	Specialization_SubtletyRogue      Specialization = "SubtletyRogue"
	Specialization_ArmsWarrior        Specialization = "ArmsWarrior"
	Specialization_FuryWarrior        Specialization = "FuryWarrior"
	Specialization_ProtectionWarrior  Specialization = "ProtectionWarrior"
	Specialization_EnhancementShaman  Specialization = "EnhancementShaman"
	Specialization_ElementalShaman    Specialization = "ElementalShaman"
	Specialization_RestorationShaman  Specialization = "RestorationShaman"
	Specialization_BalanceDruid       Specialization = "BalanceDruid"
	Specialization_CatDruid           Specialization = "CatDruid"
	Specialization_BearDruid          Specialization = "BearDruid"
	Specialization_FeralDruid         Specialization = "FeralDruid"
	Specialization_RestorationDruid   Specialization = "RestorationDruid"
	Specialization_DisciplinePriest   Specialization = "DisciplinePriest"
	Specialization_HolyPriest         Specialization = "HolyPriest"
	Specialization_ShadowPriest       Specialization = "ShadowPriest"
	Specialization_AfflictionWarlock  Specialization = "AfflictionWarlock"
	Specialization_DemonologyWarlock  Specialization = "DemonologyWarlock"
	Specialization_DestructionWarlock Specialization = "DestructionWarlock"
	Specialization_ArcaneMage         Specialization = "ArcaneMage"
	Specialization_FireMage           Specialization = "FireMage"
	Specialization_FrostMage          Specialization = "FrostMage"
	Specialization_SurvivalHunter     Specialization = "SurvivalHunter"
	Specialization_MarksmanshipHunter Specialization = "MarksmanshipHunter"
	Specialization_BeastMasteryHunter Specialization = "BeastMasteryHunter"
	Specialization_Unknown            Specialization = "Unknown"
)

func (Specialization) IsRole

func (s Specialization) IsRole(role Role) bool

type Talents

type Talents struct {
	Points [3]int64       `json:"points"`
	Spec   Specialization `json:"spec"`
	// contains filtered or unexported fields
}

func NewTalents

func NewTalents(fight *FightAnalysis, points [3]int64) *Talents

func (*Talents) BenefitsFromWindfuryTotem

func (t *Talents) BenefitsFromWindfuryTotem() bool

type TemporaryEnchant

type TemporaryEnchant struct {
	CommonConfig

	ID          int64  `json:"id"`
	Description string `json:"description"`
	SpellID     int64  `json:"spellID"`
}

type TrueFightAnalysis

type TrueFightAnalysis struct {
	Items       []FightCast `json:"items"`
	Spells      []FightCast `json:"spells"`
	Unknown     []FightCast `json:"unknown"`
	Consumables []FightCast `json:"consumables"`
}

type Zone

type Zone struct {
	ID int64 `json:"id"`
}

Directories

Path Synopsis
Code generated by gen.py; DO NOT EDIT
Code generated by gen.py; DO NOT EDIT

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL