feat: update ClassID & AscendencyID as enums #20
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Build & Spec structs within
pob/types_saved.go
now use named types (ClassName
,AscendancyName
) and enums (ClassID
,AscendancyID
) instead of strings.SelectClass(...)
&SelectAscendancyClass(...)
withinpassive_spec.go
now use enums (ClassID
,AscendancyID
). This behavior is identical to the original Lua implementation.ClassName
&AscendancyName
may be retrieved by using theClassID
orAscendancyID
respectively as an index within new maps:ClassNameByID[ClassID]
&AscendancyNameByID[AscendancyID]
SetClass(...)
&SetAscendancy(...)
withinpob/methods_saved.go
now use their respective enumerated IDsREVERTED see commit #9310a2e and my explanation below.
data.UnarmedWeaponData[...]
now uses theClassID
enum directly as an index instead ofClassName
(improves code readability)Something to note:
I considered implementing a
String()
function for getting theClassName
orAscendancyName
, but using maps with theClassID
/AscendancyID
as the index seemed more straight forward and made more sense for it belonging withintypes_saved.go
.If desired, I can change the implementation to
ClassID.String()
andAscendancyID.String()
instead of maps with their respective IDs as indexes.I just don't know where those
String()
functions should belong as the enums and maps are intypes_saved.go
.