From 5225c86d6551e33d42c506dae50fd86b8045e440 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Tue, 23 Jan 2024 23:13:23 -0600 Subject: [PATCH] chore: Misc. component cleanup (#1433) * Misc component cleanup * Update InventoryComponent.h * Update MissionComponent.h * Update PropertyManagementComponent.h * Update PropertyVendorComponent.h * Update SkillComponent.h maximum pedantry B) * SoundTriggerComponent.h braces gone * Rename SoundTriggerComponent.h braces gone to SoundTriggerComponent.h I was tired --- dGame/dComponents/BaseCombatAIComponent.h | 4 ++-- dGame/dComponents/BouncerComponent.h | 4 ++-- dGame/dComponents/BuffComponent.h | 4 ++-- dGame/dComponents/BuildBorderComponent.h | 4 ++-- dGame/dComponents/CharacterComponent.h | 4 ++-- dGame/dComponents/CollectibleComponent.h | 4 ++-- dGame/dComponents/Component.h | 3 +-- dGame/dComponents/ControllablePhysicsComponent.h | 2 +- dGame/dComponents/DestroyableComponent.h | 4 ++-- dGame/dComponents/DonationVendorComponent.h | 2 +- dGame/dComponents/GhostComponent.h | 2 +- dGame/dComponents/HavokVehiclePhysicsComponent.h | 2 +- dGame/dComponents/InventoryComponent.h | 5 ++--- dGame/dComponents/ItemComponent.h | 4 ++-- dGame/dComponents/LUPExhibitComponent.h | 4 ++-- dGame/dComponents/LevelProgressionComponent.h | 4 ++-- dGame/dComponents/MiniGameControlComponent.h | 2 +- dGame/dComponents/MissionComponent.h | 5 ++--- dGame/dComponents/MissionOfferComponent.h | 4 ++-- dGame/dComponents/ModelComponent.h | 4 ++-- dGame/dComponents/ModuleAssemblyComponent.h | 4 ++-- dGame/dComponents/MovementAIComponent.h | 4 ++-- dGame/dComponents/MovingPlatformComponent.h | 4 ++-- dGame/dComponents/MultiZoneEntranceComponent.h | 4 ++-- dGame/dComponents/PetComponent.h | 4 ++-- dGame/dComponents/PhantomPhysicsComponent.h | 4 ++-- dGame/dComponents/PlayerForcedMovementComponent.h | 4 ++-- dGame/dComponents/PossessableComponent.h | 4 ++-- dGame/dComponents/PossessorComponent.h | 4 ++-- dGame/dComponents/PropertyComponent.h | 4 ++-- dGame/dComponents/PropertyEntranceComponent.h | 4 ++-- dGame/dComponents/PropertyManagementComponent.h | 8 +++----- dGame/dComponents/PropertyVendorComponent.h | 5 ++--- dGame/dComponents/ProximityMonitorComponent.h | 4 ++-- dGame/dComponents/QuickBuildComponent.h | 4 ++-- dGame/dComponents/RacingControlComponent.h | 4 ++-- dGame/dComponents/RacingSoundTriggerComponent.h | 2 +- dGame/dComponents/RacingStatsComponent.h | 2 +- dGame/dComponents/RailActivatorComponent.h | 2 +- dGame/dComponents/RenderComponent.h | 4 ++-- .../RigidbodyPhantomPhysicsComponent.h | 2 +- .../dComponents/RocketLaunchpadControlComponent.h | 4 ++-- dGame/dComponents/ScriptedActivityComponent.h | 4 ++-- dGame/dComponents/ShootingGalleryComponent.h | 4 ++-- dGame/dComponents/SimplePhysicsComponent.h | 2 +- dGame/dComponents/SkillComponent.h | 8 ++++---- dGame/dComponents/SoundTriggerComponent.h | 15 ++++++++------- dGame/dComponents/SwitchComponent.h | 4 ++-- dGame/dComponents/TriggerComponent.h | 4 ++-- dGame/dComponents/VendorComponent.h | 2 +- dScripts/ScriptComponent.h | 4 ++-- 51 files changed, 99 insertions(+), 104 deletions(-) diff --git a/dGame/dComponents/BaseCombatAIComponent.h b/dGame/dComponents/BaseCombatAIComponent.h index 8ae04611..f00910e7 100644 --- a/dGame/dComponents/BaseCombatAIComponent.h +++ b/dGame/dComponents/BaseCombatAIComponent.h @@ -45,9 +45,9 @@ struct AiSkillEntry /** * Handles the AI of entities, making them wander, tether and attack their enemies */ -class BaseCombatAIComponent : public Component { +class BaseCombatAIComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::BASE_COMBAT_AI; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::BASE_COMBAT_AI; BaseCombatAIComponent(Entity* parentEntity, uint32_t id); ~BaseCombatAIComponent() override; diff --git a/dGame/dComponents/BouncerComponent.h b/dGame/dComponents/BouncerComponent.h index cb3d8df3..b41881c6 100644 --- a/dGame/dComponents/BouncerComponent.h +++ b/dGame/dComponents/BouncerComponent.h @@ -10,9 +10,9 @@ /** * Attached to bouncer entities, allowing other entities to bounce off of it */ -class BouncerComponent : public Component { +class BouncerComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::BOUNCER; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::BOUNCER; BouncerComponent(Entity* parentEntity); ~BouncerComponent() override; diff --git a/dGame/dComponents/BuffComponent.h b/dGame/dComponents/BuffComponent.h index 7f7b44d8..18aa7a42 100644 --- a/dGame/dComponents/BuffComponent.h +++ b/dGame/dComponents/BuffComponent.h @@ -47,9 +47,9 @@ struct Buff { /** * Allows for the application of buffs to the parent entity, altering health, armor and imagination. */ -class BuffComponent : public Component { +class BuffComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::BUFF; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::BUFF; explicit BuffComponent(Entity* parent); diff --git a/dGame/dComponents/BuildBorderComponent.h b/dGame/dComponents/BuildBorderComponent.h index 985c0388..a59ac363 100644 --- a/dGame/dComponents/BuildBorderComponent.h +++ b/dGame/dComponents/BuildBorderComponent.h @@ -14,9 +14,9 @@ /** * Component for the build border, allowing the user to start building when interacting with it */ -class BuildBorderComponent : public Component { +class BuildBorderComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::BUILD_BORDER; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::BUILD_BORDER; BuildBorderComponent(Entity* parent); ~BuildBorderComponent() override; diff --git a/dGame/dComponents/CharacterComponent.h b/dGame/dComponents/CharacterComponent.h index fae99dcb..a44d359d 100644 --- a/dGame/dComponents/CharacterComponent.h +++ b/dGame/dComponents/CharacterComponent.h @@ -61,9 +61,9 @@ enum StatisticID { /** * Represents a character, including their rockets and stats */ -class CharacterComponent : public Component { +class CharacterComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::CHARACTER; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::CHARACTER; CharacterComponent(Entity* parent, Character* character); ~CharacterComponent() override; diff --git a/dGame/dComponents/CollectibleComponent.h b/dGame/dComponents/CollectibleComponent.h index 3ff71c6f..10a23293 100644 --- a/dGame/dComponents/CollectibleComponent.h +++ b/dGame/dComponents/CollectibleComponent.h @@ -4,9 +4,9 @@ #include "Component.h" #include "eReplicaComponentType.h" -class CollectibleComponent : public Component { +class CollectibleComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::COLLECTIBLE; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::COLLECTIBLE; CollectibleComponent(Entity* parentEntity, int32_t collectibleId) : Component(parentEntity), m_CollectibleId(collectibleId) {} int16_t GetCollectibleId() const { return m_CollectibleId; } diff --git a/dGame/dComponents/Component.h b/dGame/dComponents/Component.h index d1ad0860..70f30f76 100644 --- a/dGame/dComponents/Component.h +++ b/dGame/dComponents/Component.h @@ -7,8 +7,7 @@ class Entity; /** * Component base class, provides methods for game loop updates, usage events and loading and saving to XML. */ -class Component -{ +class Component { public: Component(Entity* parent); virtual ~Component(); diff --git a/dGame/dComponents/ControllablePhysicsComponent.h b/dGame/dComponents/ControllablePhysicsComponent.h index e5c3f890..e850cfeb 100644 --- a/dGame/dComponents/ControllablePhysicsComponent.h +++ b/dGame/dComponents/ControllablePhysicsComponent.h @@ -21,7 +21,7 @@ enum class eStateChangeType : uint32_t; */ class ControllablePhysicsComponent : public PhysicsComponent { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::CONTROLLABLE_PHYSICS; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::CONTROLLABLE_PHYSICS; ControllablePhysicsComponent(Entity* entity); ~ControllablePhysicsComponent() override; diff --git a/dGame/dComponents/DestroyableComponent.h b/dGame/dComponents/DestroyableComponent.h index b81ab9f3..1f45b43e 100644 --- a/dGame/dComponents/DestroyableComponent.h +++ b/dGame/dComponents/DestroyableComponent.h @@ -17,9 +17,9 @@ enum class eStateChangeType : uint32_t; * Represents the stats of an entity, for example its health, imagination and armor. Also handles factions, which * indicate which enemies this entity has. */ -class DestroyableComponent : public Component { +class DestroyableComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::DESTROYABLE; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::DESTROYABLE; DestroyableComponent(Entity* parentEntity); ~DestroyableComponent() override; diff --git a/dGame/dComponents/DonationVendorComponent.h b/dGame/dComponents/DonationVendorComponent.h index d1743118..7eb60849 100644 --- a/dGame/dComponents/DonationVendorComponent.h +++ b/dGame/dComponents/DonationVendorComponent.h @@ -8,7 +8,7 @@ class Entity; class DonationVendorComponent final : public VendorComponent { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::DONATION_VENDOR; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::DONATION_VENDOR; DonationVendorComponent(Entity* parent); void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate) override; uint32_t GetActivityID() {return m_ActivityId;}; diff --git a/dGame/dComponents/GhostComponent.h b/dGame/dComponents/GhostComponent.h index 5ae308a4..bc4f158d 100644 --- a/dGame/dComponents/GhostComponent.h +++ b/dGame/dComponents/GhostComponent.h @@ -7,7 +7,7 @@ class NiPoint3; -class GhostComponent : public Component { +class GhostComponent final : public Component { public: static inline const eReplicaComponentType ComponentType = eReplicaComponentType::GHOST; GhostComponent(Entity* parent); diff --git a/dGame/dComponents/HavokVehiclePhysicsComponent.h b/dGame/dComponents/HavokVehiclePhysicsComponent.h index ba46f093..85a0e279 100644 --- a/dGame/dComponents/HavokVehiclePhysicsComponent.h +++ b/dGame/dComponents/HavokVehiclePhysicsComponent.h @@ -11,7 +11,7 @@ */ class HavokVehiclePhysicsComponent : public PhysicsComponent { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::HAVOK_VEHICLE_PHYSICS; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::HAVOK_VEHICLE_PHYSICS; HavokVehiclePhysicsComponent(Entity* parentEntity); diff --git a/dGame/dComponents/InventoryComponent.h b/dGame/dComponents/InventoryComponent.h index f4d38d43..e47e6a59 100644 --- a/dGame/dComponents/InventoryComponent.h +++ b/dGame/dComponents/InventoryComponent.h @@ -35,10 +35,9 @@ enum class eItemType : int32_t; * of different types, each type representing a different group of items, see `eInventoryType` for a list of * inventories. */ -class InventoryComponent : public Component -{ +class InventoryComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::INVENTORY; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::INVENTORY; explicit InventoryComponent(Entity* parent, tinyxml2::XMLDocument* document = nullptr); void Update(float deltaTime) override; diff --git a/dGame/dComponents/ItemComponent.h b/dGame/dComponents/ItemComponent.h index 3af6a91e..875ef0a5 100644 --- a/dGame/dComponents/ItemComponent.h +++ b/dGame/dComponents/ItemComponent.h @@ -4,9 +4,9 @@ #include "Component.h" #include "eReplicaComponentType.h" -class ItemComponent : public Component { +class ItemComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::ITEM; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::ITEM; ItemComponent(Entity* entity) : Component(entity) {} diff --git a/dGame/dComponents/LUPExhibitComponent.h b/dGame/dComponents/LUPExhibitComponent.h index 47b13a17..e6653868 100644 --- a/dGame/dComponents/LUPExhibitComponent.h +++ b/dGame/dComponents/LUPExhibitComponent.h @@ -11,10 +11,10 @@ * Component that handles the LOT that is shown in the LUP exhibit in the LUP world. Works by setting a timer and * switching the LOTs around that we'd like to display. */ -class LUPExhibitComponent : public Component +class LUPExhibitComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::LUP_EXHIBIT; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::LUP_EXHIBIT; LUPExhibitComponent(Entity* parent) : Component(parent) {}; void Update(float deltaTime) override; diff --git a/dGame/dComponents/LevelProgressionComponent.h b/dGame/dComponents/LevelProgressionComponent.h index 09ccec34..6083738c 100644 --- a/dGame/dComponents/LevelProgressionComponent.h +++ b/dGame/dComponents/LevelProgressionComponent.h @@ -11,9 +11,9 @@ * */ -class LevelProgressionComponent : public Component { +class LevelProgressionComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::LEVEL_PROGRESSION; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::LEVEL_PROGRESSION; /** * Constructor for this component diff --git a/dGame/dComponents/MiniGameControlComponent.h b/dGame/dComponents/MiniGameControlComponent.h index 06a9c24e..e2581b2d 100644 --- a/dGame/dComponents/MiniGameControlComponent.h +++ b/dGame/dComponents/MiniGameControlComponent.h @@ -6,7 +6,7 @@ class MiniGameControlComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::MINI_GAME_CONTROL; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::MINI_GAME_CONTROL; MiniGameControlComponent(Entity* parent) : Component(parent) {} void Serialize(RakNet::BitStream* outBitStream, bool isConstruction); diff --git a/dGame/dComponents/MissionComponent.h b/dGame/dComponents/MissionComponent.h index d53db64e..42c4df08 100644 --- a/dGame/dComponents/MissionComponent.h +++ b/dGame/dComponents/MissionComponent.h @@ -24,10 +24,9 @@ class AchievementCacheKey; * The mission inventory of an entity. Tracks mission state for each mission that can be accepted and allows for * progression of each of the mission task types (see eMissionTaskType). */ -class MissionComponent : public Component -{ +class MissionComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::MISSION; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::MISSION; explicit MissionComponent(Entity* parent); ~MissionComponent() override; diff --git a/dGame/dComponents/MissionOfferComponent.h b/dGame/dComponents/MissionOfferComponent.h index 0f0d23ba..d842a92e 100644 --- a/dGame/dComponents/MissionOfferComponent.h +++ b/dGame/dComponents/MissionOfferComponent.h @@ -59,9 +59,9 @@ private: /** * Allows entities to offer missions to other entities, depending on their mission inventory progression. */ -class MissionOfferComponent : public Component { +class MissionOfferComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::MISSION_OFFER; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::MISSION_OFFER; MissionOfferComponent(Entity* parent, LOT parentLot); diff --git a/dGame/dComponents/ModelComponent.h b/dGame/dComponents/ModelComponent.h index a36328be..0d720d04 100644 --- a/dGame/dComponents/ModelComponent.h +++ b/dGame/dComponents/ModelComponent.h @@ -22,9 +22,9 @@ class MoveToInventoryMessage; /** * Component that represents entities that are a model, e.g. collectible models and BBB models. */ -class ModelComponent : public Component { +class ModelComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::MODEL; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::MODEL; ModelComponent(Entity* parent); diff --git a/dGame/dComponents/ModuleAssemblyComponent.h b/dGame/dComponents/ModuleAssemblyComponent.h index 9e7301fe..47e7baa6 100644 --- a/dGame/dComponents/ModuleAssemblyComponent.h +++ b/dGame/dComponents/ModuleAssemblyComponent.h @@ -10,9 +10,9 @@ * same as having said items in your inventory (the subkey for this component) this component is the one that * renders the entity into the world. */ -class ModuleAssemblyComponent : public Component { +class ModuleAssemblyComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::MODULE_ASSEMBLY; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::MODULE_ASSEMBLY; ModuleAssemblyComponent(Entity* parent); ~ModuleAssemblyComponent() override; diff --git a/dGame/dComponents/MovementAIComponent.h b/dGame/dComponents/MovementAIComponent.h index 0ae71dc6..852f7001 100644 --- a/dGame/dComponents/MovementAIComponent.h +++ b/dGame/dComponents/MovementAIComponent.h @@ -55,9 +55,9 @@ struct MovementAIInfo { * Component that handles the movement settings of an entity. Not to be confused with the BaseCombatAI component that * actually handles attackig and following enemy entities. */ -class MovementAIComponent : public Component { +class MovementAIComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::MOVEMENT_AI; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::MOVEMENT_AI; MovementAIComponent(Entity* parentEntity, MovementAIInfo info); diff --git a/dGame/dComponents/MovingPlatformComponent.h b/dGame/dComponents/MovingPlatformComponent.h index bb5821d4..cf47b9c3 100644 --- a/dGame/dComponents/MovingPlatformComponent.h +++ b/dGame/dComponents/MovingPlatformComponent.h @@ -104,9 +104,9 @@ public: * don't at all do what you expect them to as we don't instruct the client of changes made here. * ^^^ Trivia: This made the red blocks platform and property platforms a pain to implement. */ -class MovingPlatformComponent : public Component { +class MovingPlatformComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::MOVING_PLATFORM; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::MOVING_PLATFORM; MovingPlatformComponent(Entity* parent, const std::string& pathName); ~MovingPlatformComponent() override; diff --git a/dGame/dComponents/MultiZoneEntranceComponent.h b/dGame/dComponents/MultiZoneEntranceComponent.h index c65dc0fe..8928be27 100644 --- a/dGame/dComponents/MultiZoneEntranceComponent.h +++ b/dGame/dComponents/MultiZoneEntranceComponent.h @@ -8,9 +8,9 @@ * Component that handles the LUP/WBL rocket launchpad that can be interacted with to travel to WBL worlds. * */ -class MultiZoneEntranceComponent : public Component { +class MultiZoneEntranceComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::MULTI_ZONE_ENTRANCE; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::MULTI_ZONE_ENTRANCE; /** * Constructor for this component, builds the m_LUPWorlds vector diff --git a/dGame/dComponents/PetComponent.h b/dGame/dComponents/PetComponent.h index 24ee157b..6d13bea9 100644 --- a/dGame/dComponents/PetComponent.h +++ b/dGame/dComponents/PetComponent.h @@ -13,10 +13,10 @@ * Represents an entity that is a pet. This pet can be tamed and consequently follows the tamer around, allowing it * to dig for treasure and activate pet bouncers. */ -class PetComponent : public Component +class PetComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::PET; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::PET; explicit PetComponent(Entity* parentEntity, uint32_t componentId); ~PetComponent() override; diff --git a/dGame/dComponents/PhantomPhysicsComponent.h b/dGame/dComponents/PhantomPhysicsComponent.h index 5fcee004..2ea9e979 100644 --- a/dGame/dComponents/PhantomPhysicsComponent.h +++ b/dGame/dComponents/PhantomPhysicsComponent.h @@ -25,9 +25,9 @@ enum class ePhysicsEffectType : uint32_t ; * trigger gameplay events, for example the bus in Avant Gardens that moves around when the player touches its physics * body. Optionally this object can also have effects, like the fans in AG. */ -class PhantomPhysicsComponent : public PhysicsComponent { +class PhantomPhysicsComponent final : public PhysicsComponent { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::PHANTOM_PHYSICS; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::PHANTOM_PHYSICS; PhantomPhysicsComponent(Entity* parent); ~PhantomPhysicsComponent() override; diff --git a/dGame/dComponents/PlayerForcedMovementComponent.h b/dGame/dComponents/PlayerForcedMovementComponent.h index 810b727c..e5aca37d 100644 --- a/dGame/dComponents/PlayerForcedMovementComponent.h +++ b/dGame/dComponents/PlayerForcedMovementComponent.h @@ -8,9 +8,9 @@ * Component that handles player forced movement * */ -class PlayerForcedMovementComponent : public Component { +class PlayerForcedMovementComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::PLAYER_FORCED_MOVEMENT; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::PLAYER_FORCED_MOVEMENT; /** * Constructor for this component diff --git a/dGame/dComponents/PossessableComponent.h b/dGame/dComponents/PossessableComponent.h index 9a767ba9..3b075d33 100644 --- a/dGame/dComponents/PossessableComponent.h +++ b/dGame/dComponents/PossessableComponent.h @@ -12,9 +12,9 @@ * Represents an entity that can be controlled by some other entity, generally used by cars to indicate that some * player is controlling it. */ -class PossessableComponent : public Component { +class PossessableComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::POSSESSABLE; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::POSSESSABLE; PossessableComponent(Entity* parentEntity, uint32_t componentId); diff --git a/dGame/dComponents/PossessorComponent.h b/dGame/dComponents/PossessorComponent.h index c225766b..e1aba048 100644 --- a/dGame/dComponents/PossessorComponent.h +++ b/dGame/dComponents/PossessorComponent.h @@ -16,9 +16,9 @@ enum class ePossessionType : uint8_t { /** * Represents an entity that can posess other entities. Generally used by players to drive a car. */ -class PossessorComponent : public Component { +class PossessorComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::POSSESSOR; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::POSSESSOR; PossessorComponent(Entity* parent); ~PossessorComponent() override; diff --git a/dGame/dComponents/PropertyComponent.h b/dGame/dComponents/PropertyComponent.h index 135a1d26..c412ccb3 100644 --- a/dGame/dComponents/PropertyComponent.h +++ b/dGame/dComponents/PropertyComponent.h @@ -20,9 +20,9 @@ struct PropertyState { /** * This component is unused and has no functionality */ -class PropertyComponent : public Component { +class PropertyComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::PROPERTY; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::PROPERTY; explicit PropertyComponent(Entity* parentEntity); ~PropertyComponent() override; [[nodiscard]] PropertyState* GetPropertyState() const { return m_PropertyState; }; diff --git a/dGame/dComponents/PropertyEntranceComponent.h b/dGame/dComponents/PropertyEntranceComponent.h index ef8f9810..510bb489 100644 --- a/dGame/dComponents/PropertyEntranceComponent.h +++ b/dGame/dComponents/PropertyEntranceComponent.h @@ -11,10 +11,10 @@ /** * Represents the launch pad that's used to select and browse properties */ -class PropertyEntranceComponent : public Component { +class PropertyEntranceComponent final : public Component { public: explicit PropertyEntranceComponent(Entity* parent, uint32_t componentID); - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::PROPERTY_ENTRANCE; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::PROPERTY_ENTRANCE; /** * Handles an OnUse request for some other entity, rendering the property browse menu diff --git a/dGame/dComponents/PropertyManagementComponent.h b/dGame/dComponents/PropertyManagementComponent.h index d38437c4..6a9ed09d 100644 --- a/dGame/dComponents/PropertyManagementComponent.h +++ b/dGame/dComponents/PropertyManagementComponent.h @@ -8,8 +8,7 @@ /** * Information regarding which players may visit this property */ -enum class PropertyPrivacyOption -{ +enum class PropertyPrivacyOption { /** * Default, only you can visit your property */ @@ -29,10 +28,9 @@ enum class PropertyPrivacyOption /** * Main component that handles interactions with a property, generally the plaques you see on properties. */ -class PropertyManagementComponent : public Component -{ +class PropertyManagementComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::PROPERTY_MANAGEMENT; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::PROPERTY_MANAGEMENT; PropertyManagementComponent(Entity* parent); static PropertyManagementComponent* Instance(); diff --git a/dGame/dComponents/PropertyVendorComponent.h b/dGame/dComponents/PropertyVendorComponent.h index 0e6c6521..fee8af9c 100644 --- a/dGame/dComponents/PropertyVendorComponent.h +++ b/dGame/dComponents/PropertyVendorComponent.h @@ -7,10 +7,9 @@ /** * The property guard that stands on a property before it's claimed, allows entities to attempt claiming this property. */ -class PropertyVendorComponent : public Component -{ +class PropertyVendorComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::PROPERTY_VENDOR; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::PROPERTY_VENDOR; explicit PropertyVendorComponent(Entity* parent); /** diff --git a/dGame/dComponents/ProximityMonitorComponent.h b/dGame/dComponents/ProximityMonitorComponent.h index 90ba7d54..512b2848 100644 --- a/dGame/dComponents/ProximityMonitorComponent.h +++ b/dGame/dComponents/ProximityMonitorComponent.h @@ -17,9 +17,9 @@ * Utility component for detecting how close entities are to named proximities for this entity. Allows you to store * proximity checks for multiple ojects. */ -class ProximityMonitorComponent : public Component { +class ProximityMonitorComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::PROXIMITY_MONITOR; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::PROXIMITY_MONITOR; ProximityMonitorComponent(Entity* parentEntity, int smallRadius = -1, int largeRadius = -1); ~ProximityMonitorComponent() override; diff --git a/dGame/dComponents/QuickBuildComponent.h b/dGame/dComponents/QuickBuildComponent.h index f1106a61..a6725a81 100644 --- a/dGame/dComponents/QuickBuildComponent.h +++ b/dGame/dComponents/QuickBuildComponent.h @@ -20,9 +20,9 @@ enum class eQuickBuildFailReason : uint32_t; * consists of an activator that shows a popup and then the actual entity that the bricks are built into. Note * that quick builds are also scripted activities so this shared some logic with the ScriptedActivityComponent. */ -class QuickBuildComponent : public Component { +class QuickBuildComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::QUICK_BUILD; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::QUICK_BUILD; QuickBuildComponent(Entity* entity); ~QuickBuildComponent() override; diff --git a/dGame/dComponents/RacingControlComponent.h b/dGame/dComponents/RacingControlComponent.h index 47341aae..4a7d387f 100644 --- a/dGame/dComponents/RacingControlComponent.h +++ b/dGame/dComponents/RacingControlComponent.h @@ -103,9 +103,9 @@ struct RacingPlayerInfo { /** * Component that's attached to a manager entity in each race zone that loads player vehicles, keep scores, etc. */ -class RacingControlComponent : public Component { +class RacingControlComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::RACING_CONTROL; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::RACING_CONTROL; RacingControlComponent(Entity* parentEntity); ~RacingControlComponent(); diff --git a/dGame/dComponents/RacingSoundTriggerComponent.h b/dGame/dComponents/RacingSoundTriggerComponent.h index 0f79c67f..140bbe20 100644 --- a/dGame/dComponents/RacingSoundTriggerComponent.h +++ b/dGame/dComponents/RacingSoundTriggerComponent.h @@ -8,7 +8,7 @@ class Entity; class RacingSoundTriggerComponent : public SoundTriggerComponent { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::RACING_SOUND_TRIGGER; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::RACING_SOUND_TRIGGER; RacingSoundTriggerComponent(Entity* parent) : SoundTriggerComponent(parent){}; }; diff --git a/dGame/dComponents/RacingStatsComponent.h b/dGame/dComponents/RacingStatsComponent.h index 9349ce49..ad1b35bf 100644 --- a/dGame/dComponents/RacingStatsComponent.h +++ b/dGame/dComponents/RacingStatsComponent.h @@ -6,7 +6,7 @@ class RacingStatsComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::RACING_STATS; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::RACING_STATS; RacingStatsComponent(Entity* parent) : Component(parent) {} }; diff --git a/dGame/dComponents/RailActivatorComponent.h b/dGame/dComponents/RailActivatorComponent.h index 28b25073..015f36b7 100644 --- a/dGame/dComponents/RailActivatorComponent.h +++ b/dGame/dComponents/RailActivatorComponent.h @@ -15,7 +15,7 @@ public: explicit RailActivatorComponent(Entity* parent, int32_t componentID); ~RailActivatorComponent() override; - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::RAIL_ACTIVATOR; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::RAIL_ACTIVATOR; /** * Handles the OnUse event from some entity, initiates the rail movement diff --git a/dGame/dComponents/RenderComponent.h b/dGame/dComponents/RenderComponent.h index 74f39625..936864fc 100644 --- a/dGame/dComponents/RenderComponent.h +++ b/dGame/dComponents/RenderComponent.h @@ -54,9 +54,9 @@ struct Effect { * Determines that a component should be visibly rendered into the world, most entities have this. This component * also handles effects that play for entities. */ -class RenderComponent : public Component { +class RenderComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::RENDER; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::RENDER; RenderComponent(Entity* entity, int32_t componentId = -1); ~RenderComponent() override; diff --git a/dGame/dComponents/RigidbodyPhantomPhysicsComponent.h b/dGame/dComponents/RigidbodyPhantomPhysicsComponent.h index bc60c38e..082dd1e7 100644 --- a/dGame/dComponents/RigidbodyPhantomPhysicsComponent.h +++ b/dGame/dComponents/RigidbodyPhantomPhysicsComponent.h @@ -19,7 +19,7 @@ */ class RigidbodyPhantomPhysicsComponent : public PhysicsComponent { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::RIGID_BODY_PHANTOM_PHYSICS; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::RIGID_BODY_PHANTOM_PHYSICS; RigidbodyPhantomPhysicsComponent(Entity* parent); diff --git a/dGame/dComponents/RocketLaunchpadControlComponent.h b/dGame/dComponents/RocketLaunchpadControlComponent.h index 06d97cd3..03d2f141 100644 --- a/dGame/dComponents/RocketLaunchpadControlComponent.h +++ b/dGame/dComponents/RocketLaunchpadControlComponent.h @@ -16,9 +16,9 @@ class PreconditionExpression; /** * Component that handles rocket launchpads that can be interacted with to travel to other worlds. */ -class RocketLaunchpadControlComponent : public Component { +class RocketLaunchpadControlComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::ROCKET_LAUNCH; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::ROCKET_LAUNCH; RocketLaunchpadControlComponent(Entity* parent, int rocketId); ~RocketLaunchpadControlComponent() override; diff --git a/dGame/dComponents/ScriptedActivityComponent.h b/dGame/dComponents/ScriptedActivityComponent.h index 79a9593d..308a0a86 100644 --- a/dGame/dComponents/ScriptedActivityComponent.h +++ b/dGame/dComponents/ScriptedActivityComponent.h @@ -6,9 +6,9 @@ class Entity; -class ScriptedActivityComponent : public ActivityComponent { +class ScriptedActivityComponent final : public ActivityComponent { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::SCRIPTED_ACTIVITY; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::SCRIPTED_ACTIVITY; ScriptedActivityComponent(Entity* parent, int activityID) : ActivityComponent(parent, activityID){}; }; diff --git a/dGame/dComponents/ShootingGalleryComponent.h b/dGame/dComponents/ShootingGalleryComponent.h index 4024e99a..c4b8fea2 100644 --- a/dGame/dComponents/ShootingGalleryComponent.h +++ b/dGame/dComponents/ShootingGalleryComponent.h @@ -71,9 +71,9 @@ struct StaticShootingGalleryParams { * A very ancient component that was used to guide shooting galleries, it's still kind of used but a lot of logic is * also in the related scripts. */ -class ShootingGalleryComponent : public Component { +class ShootingGalleryComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::SHOOTING_GALLERY; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::SHOOTING_GALLERY; explicit ShootingGalleryComponent(Entity* parent); ~ShootingGalleryComponent(); diff --git a/dGame/dComponents/SimplePhysicsComponent.h b/dGame/dComponents/SimplePhysicsComponent.h index 752fef0b..707f8a41 100644 --- a/dGame/dComponents/SimplePhysicsComponent.h +++ b/dGame/dComponents/SimplePhysicsComponent.h @@ -28,7 +28,7 @@ enum class eClimbableType : int32_t { */ class SimplePhysicsComponent : public PhysicsComponent { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::SIMPLE_PHYSICS; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::SIMPLE_PHYSICS; SimplePhysicsComponent(Entity* parent, uint32_t componentID); ~SimplePhysicsComponent() override; diff --git a/dGame/dComponents/SkillComponent.h b/dGame/dComponents/SkillComponent.h index 2d8628ef..530c2a25 100644 --- a/dGame/dComponents/SkillComponent.h +++ b/dGame/dComponents/SkillComponent.h @@ -1,6 +1,6 @@ /* * Darkflame Universe - * Copyright 2018 + * Copyright 2024 */ #ifndef SKILLCOMPONENT_H @@ -55,11 +55,11 @@ struct SkillExecutionResult { * * Skills are a built up by a tree of behaviors. See dGame/dBehaviors/ for a list of behaviors. * - * This system is very conveluted and still has a lot of unknowns. + * This system is very convoluted and still has a lot of unknowns. */ -class SkillComponent : public Component { +class SkillComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::SKILL; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::SKILL; explicit SkillComponent(Entity* parent); ~SkillComponent() override; diff --git a/dGame/dComponents/SoundTriggerComponent.h b/dGame/dComponents/SoundTriggerComponent.h index 56c71770..48366017 100644 --- a/dGame/dComponents/SoundTriggerComponent.h +++ b/dGame/dComponents/SoundTriggerComponent.h @@ -1,4 +1,5 @@ #pragma once + #include "dCommonVars.h" #include "Entity.h" #include "GUID.h" @@ -43,7 +44,7 @@ struct GUIDResults{ void Serialize(RakNet::BitStream* outBitStream); }; -struct MixerProgram{ +struct MixerProgram { std::string name; uint32_t result; @@ -58,7 +59,7 @@ struct MixerProgram{ class SoundTriggerComponent : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::SOUND_TRIGGER; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::SOUND_TRIGGER; explicit SoundTriggerComponent(Entity* parent); void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate) override; void ActivateMusicCue(const std::string& name, float bordemTime = -1.0); @@ -66,11 +67,11 @@ public: private: - std::vector m_MusicCues = {}; - std::vector m_MusicParameters = {}; - std::vector m_2DAmbientSounds = {}; - std::vector m_3DAmbientSounds = {}; - std::vector m_MixerPrograms = {}; + std::vector m_MusicCues; + std::vector m_MusicParameters; + std::vector m_2DAmbientSounds; + std::vector m_3DAmbientSounds; + std::vector m_MixerPrograms; bool m_Dirty = false; }; diff --git a/dGame/dComponents/SwitchComponent.h b/dGame/dComponents/SwitchComponent.h index 7f2c3498..f732a8c1 100644 --- a/dGame/dComponents/SwitchComponent.h +++ b/dGame/dComponents/SwitchComponent.h @@ -14,9 +14,9 @@ /** * A component for switches in game, including pet triggered switches. */ -class SwitchComponent : public Component { +class SwitchComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::SWITCH; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::SWITCH; SwitchComponent(Entity* parent); ~SwitchComponent() override; diff --git a/dGame/dComponents/TriggerComponent.h b/dGame/dComponents/TriggerComponent.h index 90ecc52c..5610f24a 100644 --- a/dGame/dComponents/TriggerComponent.h +++ b/dGame/dComponents/TriggerComponent.h @@ -5,9 +5,9 @@ #include "LUTriggers.h" #include "eReplicaComponentType.h" -class TriggerComponent : public Component { +class TriggerComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::TRIGGER; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::TRIGGER; explicit TriggerComponent(Entity* parent, const std::string triggerInfo); diff --git a/dGame/dComponents/VendorComponent.h b/dGame/dComponents/VendorComponent.h index 7924a928..48b766d2 100644 --- a/dGame/dComponents/VendorComponent.h +++ b/dGame/dComponents/VendorComponent.h @@ -20,7 +20,7 @@ struct SoldItem { class VendorComponent : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::VENDOR; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::VENDOR; VendorComponent(Entity* parent); void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate) override; diff --git a/dScripts/ScriptComponent.h b/dScripts/ScriptComponent.h index cabbf8bf..a28c9419 100644 --- a/dScripts/ScriptComponent.h +++ b/dScripts/ScriptComponent.h @@ -17,9 +17,9 @@ class Entity; * Handles the loading and execution of server side scripts on entities, scripts were originally written in Lua, * here they're written in C++ */ -class ScriptComponent : public Component { +class ScriptComponent final : public Component { public: - inline static const eReplicaComponentType ComponentType = eReplicaComponentType::SCRIPT; + static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::SCRIPT; ScriptComponent(Entity* parent, std::string scriptName, bool serialized, bool client = false); ~ScriptComponent() override;