Documentation
¶
Index ¶
- Constants
- type AbilityCaster
- type CustomRotation
- type CustomSpell
- type CustomSpellCondition
- type GCDScheduler
- func (gs *GCDScheduler) DoNextAbility(sim *core.Simulation, character *core.Character) bool
- func (gs *GCDScheduler) Reset(sim *core.Simulation, character *core.Character)
- func (gs *GCDScheduler) Schedule(newAbility ScheduledAbility) time.Duration
- func (gs *GCDScheduler) ScheduleGroup(newAbilities []ScheduledAbility) time.Duration
- func (gs *GCDScheduler) ScheduleMCD(character *core.Character, mcdID core.ActionID)
- type ManaSpendingRateTracker
- func (tracker *ManaSpendingRateTracker) ManaSpentPerSecond(sim *core.Simulation, character *core.Character) float64
- func (tracker *ManaSpendingRateTracker) ProjectedManaCost(sim *core.Simulation, character *core.Character) float64
- func (tracker *ManaSpendingRateTracker) ProjectedManaSurplus(sim *core.Simulation, character *core.Character) bool
- func (tracker *ManaSpendingRateTracker) ProjectedRemainingMana(sim *core.Simulation, character *core.Character) float64
- func (tracker *ManaSpendingRateTracker) Reset()
- func (tracker *ManaSpendingRateTracker) Update(sim *core.Simulation, character *core.Character)
- type ScheduledAbility
- type WaitAction
- func (action WaitAction) Cast(sim *core.Simulation) bool
- func (action WaitAction) GetActionID() core.ActionID
- func (action WaitAction) GetDuration() time.Duration
- func (action WaitAction) GetManaCost() float64
- func (action WaitAction) GetName() string
- func (action WaitAction) GetTag() int32
- func (action WaitAction) GetUnit() *core.Unit
- type WaitReason
Constants ¶
const Unresolved = time.Duration(-1)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbilityCaster ¶
type AbilityCaster func(sim *core.Simulation) bool
Returns whether the cast was successful.
type CustomRotation ¶
type CustomRotation struct {
// contains filtered or unexported fields
}
func NewCustomRotation ¶
func NewCustomRotation(crProto *proto.CustomRotation, character *core.Character, spellsMap map[int32]CustomSpell) *CustomRotation
func (*CustomRotation) Cast ¶
func (cr *CustomRotation) Cast(sim *core.Simulation)
func (*CustomRotation) ChooseSpell ¶
func (cr *CustomRotation) ChooseSpell(sim *core.Simulation) *core.Spell
type CustomSpell ¶
type CustomSpell struct { Spell *core.Spell Condition CustomSpellCondition }
type CustomSpellCondition ¶
type CustomSpellCondition func(*core.Simulation) bool
type GCDScheduler ¶
type GCDScheduler struct {
// contains filtered or unexported fields
}
func (*GCDScheduler) DoNextAbility ¶
func (gs *GCDScheduler) DoNextAbility(sim *core.Simulation, character *core.Character) bool
Returns whether the cast was a success.
func (*GCDScheduler) Reset ¶
func (gs *GCDScheduler) Reset(sim *core.Simulation, character *core.Character)
func (*GCDScheduler) Schedule ¶
func (gs *GCDScheduler) Schedule(newAbility ScheduledAbility) time.Duration
Returns the actual time at which the ability will be cast.
func (*GCDScheduler) ScheduleGroup ¶
func (gs *GCDScheduler) ScheduleGroup(newAbilities []ScheduledAbility) time.Duration
Schedules a group of abilities that must be cast back-to-back. Most settings are taken from the first ability.
func (*GCDScheduler) ScheduleMCD ¶
func (gs *GCDScheduler) ScheduleMCD(character *core.Character, mcdID core.ActionID)
Takes ownership of a MCD, adding it to the schedule and removing it from the character's managed cooldowns.
type ManaSpendingRateTracker ¶
type ManaSpendingRateTracker struct {
// contains filtered or unexported fields
}
Tracks how fast mana is being spent. This is used by some specs to decide whether to use more mana-efficient or higher-dps spells.
func NewManaSpendingRateTracker ¶
func NewManaSpendingRateTracker() ManaSpendingRateTracker
func (*ManaSpendingRateTracker) ManaSpentPerSecond ¶
func (tracker *ManaSpendingRateTracker) ManaSpentPerSecond(sim *core.Simulation, character *core.Character) float64
func (*ManaSpendingRateTracker) ProjectedManaCost ¶
func (tracker *ManaSpendingRateTracker) ProjectedManaCost(sim *core.Simulation, character *core.Character) float64
The amount of mana we will need to spend over the remaining sim duration at the current rate of mana spending.
func (*ManaSpendingRateTracker) ProjectedManaSurplus ¶
func (tracker *ManaSpendingRateTracker) ProjectedManaSurplus(sim *core.Simulation, character *core.Character) bool
func (*ManaSpendingRateTracker) ProjectedRemainingMana ¶
func (tracker *ManaSpendingRateTracker) ProjectedRemainingMana(sim *core.Simulation, character *core.Character) float64
func (*ManaSpendingRateTracker) Reset ¶
func (tracker *ManaSpendingRateTracker) Reset()
This needs to be called on sim reset.
func (*ManaSpendingRateTracker) Update ¶
func (tracker *ManaSpendingRateTracker) Update(sim *core.Simulation, character *core.Character)
This needs to be called at regular intervals to update the tracker's data.
type ScheduledAbility ¶
type ScheduledAbility struct { // When to cast this ability. Might not cast at this time if there are conflicts. DesiredCastAt time.Duration // Limits the search window for conflict resolution. MinCastAt time.Duration MaxCastAt time.Duration // Override the default conflict resolution behavior of searching after the // desired cast time first. Instead, search before the desired cast time first. PrioritizeEarlierForConflicts bool // How much GCD time will be used by this ability. Duration time.Duration // How to cast this ability. TryCast AbilityCaster // contains filtered or unexported fields }
type WaitAction ¶
type WaitAction struct {
// contains filtered or unexported fields
}
func NewWaitAction ¶
func NewWaitAction(sim *core.Simulation, unit *core.Unit, duration time.Duration, reason WaitReason) WaitAction
func (WaitAction) Cast ¶
func (action WaitAction) Cast(sim *core.Simulation) bool
func (WaitAction) GetActionID ¶
func (action WaitAction) GetActionID() core.ActionID
func (WaitAction) GetDuration ¶
func (action WaitAction) GetDuration() time.Duration
func (WaitAction) GetManaCost ¶
func (action WaitAction) GetManaCost() float64
func (WaitAction) GetName ¶
func (action WaitAction) GetName() string
func (WaitAction) GetTag ¶
func (action WaitAction) GetTag() int32
func (WaitAction) GetUnit ¶
func (action WaitAction) GetUnit() *core.Unit
type WaitReason ¶
type WaitReason byte
const ( WaitReasonNone WaitReason = iota // unknown why we waited WaitReasonOOM // no mana to cast WaitReasonRotation // waiting on rotation WaitReasonOptimal // waiting because its more optimal than casting. )