Skip to content

Provide a ToString method to resource stats #19

@greenstack

Description

@greenstack

Currently, there isn't an easy way to print out the values of a resource stat. Given how many times I've written something like $"HP: {hp.CurrentValue}/{hp.MaxValue}", I think a ToString override is warranted. I'd like for it to behave like I've shown earlier, where it's formatted {stat.CurrentValue}/{stat.MaxValue}, but also so we can write $"HP: {hp}" instead.

The benefits of this include:

  1. Code duplication reduction
  2. Debug assistance (most debuggers use ToString() to show the state of the object in their various debug views)
  3. Code simplification

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions