Skip to content

Commit

Permalink
Fix fmt errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyt857 committed Jul 30, 2023
1 parent fe5ce2a commit e03e1eb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
8 changes: 8 additions & 0 deletions sim/core/apl_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down Expand Up @@ -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{}
Expand Down
8 changes: 4 additions & 4 deletions sim/core/apl_values_aura.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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())
}
4 changes: 2 additions & 2 deletions sim/core/apl_values_encounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions sim/core/apl_values_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e03e1eb

Please sign in to comment.