From e03e1ebbf3cc0fb29c4de583d718c72da304991c Mon Sep 17 00:00:00 2001 From: James Tanner Date: Sun, 30 Jul 2023 16:15:15 -0700 Subject: [PATCH] Fix fmt errors --- sim/core/apl_helpers.go | 8 ++++++++ sim/core/apl_values_aura.go | 8 ++++---- sim/core/apl_values_encounter.go | 4 ++-- sim/core/apl_values_resources.go | 4 ++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/sim/core/apl_helpers.go b/sim/core/apl_helpers.go index 0a7443effb..f5f3e8a740 100644 --- a/sim/core/apl_helpers.go +++ b/sim/core/apl_helpers.go @@ -21,6 +21,10 @@ func (ur UnitReference) Get() *Unit { } } +func (ur *UnitReference) String() string { + return ur.Get().Label +} + func NewUnitReference(ref *proto.UnitReference, contextUnit *Unit) UnitReference { if ref == nil || ref.Type == proto.UnitReference_Unknown { return UnitReference{} @@ -70,6 +74,10 @@ func (ar *AuraReference) Get() *Aura { } } +func (ar *AuraReference) String() string { + return ar.Get().ActionID.String() +} + func newAuraReferenceHelper(sourceUnit UnitReference, auraId *proto.ActionID, auraGetter func(*Unit, ActionID) *Aura) AuraReference { if sourceUnit.Get() == nil { return AuraReference{} diff --git a/sim/core/apl_values_aura.go b/sim/core/apl_values_aura.go index 3035ea072b..0e61b89197 100644 --- a/sim/core/apl_values_aura.go +++ b/sim/core/apl_values_aura.go @@ -28,7 +28,7 @@ func (value *APLValueAuraIsActive) GetBool(sim *Simulation) bool { return value.aura.Get().IsActive() } func (value *APLValueAuraIsActive) String() string { - return fmt.Sprintf("Aura Is Active(%s)", value.aura) + return fmt.Sprintf("Aura Is Active(%s)", value.aura.String()) } type APLValueAuraRemainingTime struct { @@ -52,7 +52,7 @@ func (value *APLValueAuraRemainingTime) GetDuration(sim *Simulation) time.Durati return value.aura.Get().RemainingDuration(sim) } func (value *APLValueAuraRemainingTime) String() string { - return fmt.Sprintf("Aura Remaining Time(%s)", value.aura) + return fmt.Sprintf("Aura Remaining Time(%s)", value.aura.String()) } type APLValueAuraNumStacks struct { @@ -80,7 +80,7 @@ func (value *APLValueAuraNumStacks) GetInt(sim *Simulation) int32 { return value.aura.Get().GetStacks() } func (value *APLValueAuraNumStacks) String() string { - return fmt.Sprintf("Aura Num Stacks(%s)", value.aura) + return fmt.Sprintf("Aura Num Stacks(%s)", value.aura.String()) } type APLValueAuraInternalCooldown struct { @@ -104,5 +104,5 @@ func (value *APLValueAuraInternalCooldown) GetDuration(sim *Simulation) time.Dur return value.aura.Get().Icd.TimeToReady(sim) } func (value *APLValueAuraInternalCooldown) String() string { - return fmt.Sprintf("Aura ICD(%s)", value.aura) + return fmt.Sprintf("Aura ICD(%s)", value.aura.String()) } diff --git a/sim/core/apl_values_encounter.go b/sim/core/apl_values_encounter.go index 841bfdbdcc..250a5f9a52 100644 --- a/sim/core/apl_values_encounter.go +++ b/sim/core/apl_values_encounter.go @@ -38,7 +38,7 @@ func (value *APLValueCurrentTimePercent) GetFloat(sim *Simulation) float64 { return sim.CurrentTime.Seconds() / sim.Duration.Seconds() } func (value *APLValueCurrentTimePercent) String() string { - return fmt.Sprintf("Current Time %") + return fmt.Sprintf("Current Time %%") } type APLValueRemainingTime struct { @@ -72,7 +72,7 @@ func (value *APLValueRemainingTimePercent) GetFloat(sim *Simulation) float64 { return sim.GetRemainingDurationPercent() } func (value *APLValueRemainingTimePercent) String() string { - return fmt.Sprintf("Remaining Time %") + return fmt.Sprintf("Remaining Time %%") } type APLValueNumberTargets struct { diff --git a/sim/core/apl_values_resources.go b/sim/core/apl_values_resources.go index 1aee64a345..dbafec7cde 100644 --- a/sim/core/apl_values_resources.go +++ b/sim/core/apl_values_resources.go @@ -59,7 +59,7 @@ func (value *APLValueCurrentHealthPercent) GetFloat(sim *Simulation) float64 { return value.unit.Get().CurrentHealthPercent() } func (value *APLValueCurrentHealthPercent) String() string { - return fmt.Sprintf("Current Health %") + return fmt.Sprintf("Current Health %%") } type APLValueCurrentMana struct { @@ -115,7 +115,7 @@ func (value *APLValueCurrentManaPercent) GetFloat(sim *Simulation) float64 { return value.unit.Get().CurrentManaPercent() } func (value *APLValueCurrentManaPercent) String() string { - return fmt.Sprintf("Current Mana %") + return fmt.Sprintf("Current Mana %%") } type APLValueCurrentRage struct {