common

package
v0.1.36 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
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 CustomAction added in v0.1.1

type CustomAction func(*core.Simulation, *core.Unit) (bool, float64)

Custom action based on a condition. Returns a bool and the CurCast cost.

type CustomCondition added in v0.1.1

type CustomCondition func(*core.Simulation) bool

Custom condition for an action.

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) bool

func (*CustomRotation) ChooseSpell

func (cr *CustomRotation) ChooseSpell(sim *core.Simulation) *CustomSpell

type CustomRotationType added in v0.1.6

type CustomRotationType byte
const (
	Basic CustomRotationType = iota
	CPM
)

type CustomSpell

type CustomSpell struct {
	Spell      *core.Spell // Might be nil if this is not a spell action.
	Action     CustomAction
	Condition  CustomCondition
	DesiredCPM float64
	// contains filtered or unexported fields
}

func (*CustomSpell) CPM added in v0.1.6

func (cs *CustomSpell) CPM(sim *core.Simulation) float64

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 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.
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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