Cleanup Trackers
hammy275 opened this issue ยท 1 comments
The different types of trackers in ImmersiveMC's codebase are a mess. This needs to be cleaned up, mainly by having AbstractVRHandsTracker
and AbstractVRHandTracker
both extend AbstractTracker
and use that system, rather than the former extending the latter, which is itself especially atrocious.
There should also be an AbstractTrackerWithCooldown
or similar that handles all the cooldown-related tasks, so I don't have to replicate that code a dozen times.
With the new BottleAndBucketTracker
, this situation is actually even worse now, since I needed that tracker to be available on both logical sides.
Given everything in the codebase, here's everything that should be changed:
Abstract Classes
AbstractTracker
should have inbuilt cooldown support. Nearly every tracker uses cooldowns, and it's only one emptyHashMap
if we don't end up using it.AbstractVRHandsTracker
should be rewritten to be based directly onAbstractTracker
, and should be moved tocommon
. TheLastTickData
can be filled as it already is by the server, and can be taken fromLastClientVRData
on the client.AbstractVRHandTracker
should be rewritten to extendAbstractVRHandsTracker
, and should be moved tocommon
.ServerTrackerInit#globalTrackers
should be killed off.
Implementations
RangedGrabTrackerServer
should find the info for the provided ticked player. There have been crashes before where I've accidentally used theplayer
parameter, and it's downright stupid that I built a system where it's unused anyways.- Rewrite
BottleAndBucketTracker
to be aAbstractVRHandTracker
. - Remove all the tracker-specific cooldown management, since it will now be handled in
AbstractTracker
. - Remove
LastVRDataTracker
, and put its logic directly intoClientLogicSubscriber
. Since it's not directly gameplay-related, nor an abstraction for trackers to build off of, it shouldn't be some form ofAbstractTracker
.