refactor(component): racing control and gate rush share the client's racing control base

LWOBaseRacingControlComponent (an activity component) is the base of the
client's racing control (71) and gate rush control (103); DLU gets the same
BaseRacingControlComponent. Nothing sent changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-10-01 14:23:38 -05:00
parent 4bfdeec369
commit 0e611bc76c
4 changed files with 24 additions and 8 deletions

View File

@@ -0,0 +1,15 @@
#ifndef BASERACINGCONTROLCOMPONENT_H
#define BASERACINGCONTROLCOMPONENT_H
#include "ActivityComponent.h"
/**
* The base of the racing controls, as the client's LWOBaseRacingControlComponent: an activity component that racing
* control (71) and gate rush control (103) are built on (its function table extends the activity component's).
*/
class BaseRacingControlComponent : public ActivityComponent {
protected:
BaseRacingControlComponent(Entity* parent, const int32_t componentID) : ActivityComponent(parent, componentID) {}
};
#endif // BASERACINGCONTROLCOMPONENT_H

View File

@@ -1,17 +1,18 @@
#ifndef GATERUSHCOMPONENT_H #ifndef GATERUSHCOMPONENT_H
#define GATERUSHCOMPONENT_H #define GATERUSHCOMPONENT_H
#include "Component.h" #include "BaseRacingControlComponent.h"
#include "eReplicaComponentType.h" #include "eReplicaComponentType.h"
/** /**
* Gate rush, as the client's LWOGateRushComponent makes it from the registry. Nothing of it is sent or done on the server yet. * Gate rush control, as the client's LWOGateRushControlComponent makes it from the registry: a racing control
* (BaseRacingControlComponent). Nothing of it is sent or done on the server yet.
*/ */
class GateRushComponent final : public Component { class GateRushComponent final : public BaseRacingControlComponent {
public: public:
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::GATE_RUSH_CONTROL; static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::GATE_RUSH_CONTROL;
GateRushComponent(Entity* parent, const int32_t componentID) : Component(parent, componentID) {} GateRushComponent(Entity* parent, const int32_t componentID) : BaseRacingControlComponent(parent, componentID) {}
}; };
#endif // GATERUSHCOMPONENT_H #endif // GATERUSHCOMPONENT_H

View File

@@ -38,7 +38,7 @@
#endif #endif
RacingControlComponent::RacingControlComponent(Entity* parent, const int32_t componentID) RacingControlComponent::RacingControlComponent(Entity* parent, const int32_t componentID)
: ActivityComponent(parent, componentID) { : BaseRacingControlComponent(parent, componentID) {
m_PathName = u"MainPath"; m_PathName = u"MainPath";
m_NumberOfLaps = 3; m_NumberOfLaps = 3;
m_RemainingLaps = m_NumberOfLaps; m_RemainingLaps = m_NumberOfLaps;
@@ -63,7 +63,7 @@ RacingControlComponent::RacingControlComponent(Entity* parent, const int32_t com
// After the activity's own loading: the race's activity is the one of this world (42 when none) // After the activity's own loading: the race's activity is the one of this world (42 when none)
void RacingControlComponent::LoadConfigData() { void RacingControlComponent::LoadConfigData() {
ActivityComponent::LoadConfigData(); BaseRacingControlComponent::LoadConfigData();
const auto worldID = Game::server->GetZoneID(); const auto worldID = Game::server->GetZoneID();
m_ActivityID = 42; m_ActivityID = 42;

View File

@@ -6,7 +6,7 @@
#include "BitStream.h" #include "BitStream.h"
#include "Entity.h" #include "Entity.h"
#include "ActivityComponent.h" #include "BaseRacingControlComponent.h"
#include "eReplicaComponentType.h" #include "eReplicaComponentType.h"
#include <chrono> #include <chrono>
@@ -121,7 +121,7 @@ struct RacingPlayerInfo {
struct Path; struct Path;
struct PathWaypoint; struct PathWaypoint;
class RacingControlComponent final : public ActivityComponent { class RacingControlComponent final : public BaseRacingControlComponent {
public: public:
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::RACING_CONTROL; static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::RACING_CONTROL;