-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raidemulator: Refactor CombatantState
object
#5387
raidemulator: Refactor CombatantState
object
#5387
Conversation
…` interface properties
@valarnin Thanks for your contribution! 🌵🚀 |
CombatantState
custom properties with `PluginCombatantState…CombatantState
in preparation for combatantMemory
lines
CombatantState
in preparation for combatantMemory
linesCombatantState
object
I've identified an annoying issue with state tracking that is going to require rewriting the logic for the state calculation a bit. Basically, because |
Rework combatant state tracking to carry forward all calculated values properly
Change casing on world_id.ts types
Issues are resolved, the automatic generator for |
This all looks good to me, thanks. Do you feel like it still needs more testing or is this good to land? |
There was a bug fix that didn't get committed properly, apparently. More jank with my weird setup using WSL 🙃 I think this is good to go now. |
This PR is in preparation for `combatantMemory` lines. Because the state tracker will now need to track all possible `PluginCombatantState` properties, it no longer makes sense to track a limited set for most other types of lines and a full state for those specific lines. As such, the custom properties on `CombatantState` have been removed in favor of just implementing the `PluginCombatantState` interface with the carried over addition of a `targetable` property to maintain functionality. Additionally, logic for constructing and cloning states was greatly simplified to use `Object.assign` instead. Some duplicate properties were removed from `Combatant` in favor of the tracked state entries in `CombatantState`, and associated locations were updated to instead read the initial combatant state's version of those properties. This should result in more correct behavior when `getCombatants` is used, because name changes are tracked properly now for example. The vast majority of the added lines are in a new `resources/world_id.ts` file, required to translate `ID` <=> `Name`. Excluding that file, the initial commit for this PR contains 166 additions and 205 deletions. This PR needs more testing before being merged. - I have only tested with US DC names, for example, so I'm not sure if world name lookup will work as expected for `CN`/`KO`/`JP` servers. - I have not tested for logs that may have weird values for some entries that would potentially result in `parseFloat` returning `NaN`. - I have only tested recent content (DSRU, P8S, and TOP). Some older content should probably be tested. 401a4e4
This PR is in preparation for
combatantMemory
lines.Because the state tracker will now need to track all possible
PluginCombatantState
properties, it no longer makes sense to track a limited set for most other types of lines and a full state for those specific lines.As such, the custom properties on
CombatantState
have been removed in favor of just implementing thePluginCombatantState
interface with the carried over addition of atargetable
property to maintain functionality.Additionally, logic for constructing and cloning states was greatly simplified to use
Object.assign
instead.Some duplicate properties were removed from
Combatant
in favor of the tracked state entries inCombatantState
, and associated locations were updated to instead read the initial combatant state's version of those properties. This should result in more correct behavior whengetCombatants
is used, because name changes are tracked properly now for example.The vast majority of the added lines are in a new
resources/world_id.ts
file, required to translateID
<=>Name
. Excluding that file, the initial commit for this PR contains 166 additions and 205 deletions.This PR needs more testing before being merged.
CN
/KO
/JP
servers.parseFloat
returningNaN
.