Skip to content

Commit

Permalink
Make GameDependencies default-constructible
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkrupinski committed Sep 23, 2024
1 parent 5dfc4d9 commit 2f6fca5
Show file tree
Hide file tree
Showing 34 changed files with 68 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/FeatureHelpers/StylePropertiesSymbolsAndVMTs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

template <typename... StyleProperties>
struct StylePropertiesSymbolsAndVMTsBase {
StylePropertiesSymbolsAndVMTsBase() = default;

StylePropertiesSymbolsAndVMTsBase(StylePropertySymbolMap symbolMap, const VmtFinder& panoramaVmtFinder) noexcept
: symbols{symbolMap.findSymbol(StyleProperties::kName)...}
, vmts{panoramaVmtFinder.findVmt(StyleProperties::kMangledTypeName)...}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/ConVarDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/ConVarOffset.h>

struct ConVarDeps {
ConVarDeps() = default;

template <typename ConVarPatterns>
explicit ConVarDeps(const ConVarPatterns& conVarPatterns) noexcept
: offsetToConVarValueType{conVarPatterns.offsetToConVarValueType()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/CvarDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/CvarOffset.h>

struct CvarDeps {
CvarDeps() = default;

template <typename CvarPatterns>
explicit CvarDeps(const CvarPatterns& cvarPatterns) noexcept
: cvar{cvarPatterns.cvar()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/EntitiesVMTs.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ using KnownEntityTypes = std::tuple<
>;

struct EntitiesVMTs {
EntitiesVMTs() = default;

explicit EntitiesVMTs(const VmtFinder& clientVmtFinder) noexcept
{
initVmts(clientVmtFinder, std::type_identity<KnownEntityTypes>{});
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/EntityDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/EntityOffset.h>

struct EntityDeps {
EntityDeps() = default;

template <typename EntityPatterns>
explicit EntityDeps(const EntityPatterns& entityPatterns) noexcept
: offsetToGameSceneNode{entityPatterns.offsetToGameSceneNode()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/EntitySystemDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <GameClasses/OffsetTypes/EntitySystemOffset.h>

struct EntitySystemDeps {
EntitySystemDeps() = default;

template <typename EntitySystemPatterns>
explicit EntitySystemDeps(const EntitySystemPatterns& entitySystemPatterns) noexcept
: entitySystem{entitySystemPatterns.entitySystem()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/FileNameSymbolTableDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <GameDLLs/Tier0Dll.h>

struct FileNameSymbolTableDeps {
FileNameSymbolTableDeps() = default;

explicit FileNameSymbolTableDeps(Tier0Dll tier0Dll) noexcept
: string{ tier0Dll.filenameSymbolTableString() }
{
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/FileSystemDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/FileSystemOffset.h>

struct FileSystemDeps {
FileSystemDeps() = default;

template <typename FileSystemPatterns>
explicit FileSystemDeps(const FileSystemPatterns& fileSystemPatterns) noexcept
: fileNamesOffset{fileSystemPatterns.fileNamesOffset()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/GameDependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#include <Platform/VmtFinder.h>

struct GameDependencies {
GameDependencies() = default;

GameDependencies(const MemoryPatterns& memoryPatterns, const VmtFinder& clientVmtFinder, const VmtFinder& panoramaVmtFinder, Tier0Dll tier0Dll) noexcept
: conVarDeps{memoryPatterns.conVarPatterns()}
, cvarDeps{memoryPatterns.cvarPatterns()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/GameRulesDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/GameRulesOffset.h>

struct GameRulesDeps {
GameRulesDeps() = default;

template <typename GameRulesPatterns>
explicit GameRulesDeps(const GameRulesPatterns& gameRulesPatterns) noexcept
: gameRules{gameRulesPatterns.gameRules()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/GameSceneNodeDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/GameSceneNodeOffset.h>

struct GameSceneNodeDeps {
GameSceneNodeDeps() = default;

template <typename GameSceneNodePatterns>
explicit GameSceneNodeDeps(const GameSceneNodePatterns& gameSceneNodePatterns) noexcept
: offsetToAbsOrigin{gameSceneNodePatterns.offsetToAbsOrigin()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/GlobalVarsDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <CS2/Classes/GlobalVars.h>

struct GlobalVarsDeps {
GlobalVarsDeps() = default;

template <typename ClientPatterns>
explicit GlobalVarsDeps(const ClientPatterns& clientPatterns) noexcept
: globalVars{clientPatterns.globalVars()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/GlowSceneObjectDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/GlowSceneObjectOffset.h>

struct GlowSceneObjectDeps {
GlowSceneObjectDeps() = default;

template <typename GlowSceneObjectPatterns>
explicit GlowSceneObjectDeps(const GlowSceneObjectPatterns& glowSceneObjectPatterns) noexcept
: offsetToGlowSceneObjectEntity{glowSceneObjectPatterns.offsetToGlowSceneObjectEntity()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/HostageServicesDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/HostageServicesOffset.h>

struct HostageServicesDeps {
HostageServicesDeps() = default;

template <typename HostageServicesPatterns>
explicit HostageServicesDeps(const HostageServicesPatterns& hostageServicesPatterns) noexcept
: offsetToCarriedHostage{hostageServicesPatterns.offsetToCarriedHostage()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/HudDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <CS2/Panorama/PanelHandle.h>

struct HudDeps {
HudDeps() = default;

template <typename ClientPatterns>
explicit HudDeps(const ClientPatterns& clientPatterns) noexcept
: hud{clientPatterns.hudPanel()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/MemAllocDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <Utils/FieldOffset.h>

struct MemAllocDeps {
MemAllocDeps() = default;

template <typename MemAllocPatterns>
MemAllocDeps(Tier0Dll tier0Dll, const MemAllocPatterns& memAllocPatterns) noexcept
: thisptr{tier0Dll.memAlloc()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/PanelDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <CS2/Panorama/CPanel2D.h>

struct PanelDeps {
PanelDeps() = default;

template <typename PanelPatterns>
explicit PanelDeps(const PanelPatterns& panelPatterns) noexcept
: create{panelPatterns.create()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/PanelStyleDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <CS2/Panorama/CPanelStyle.h>

struct PanelStyleDeps {
PanelStyleDeps() = default;

template <typename PanelStylePatterns>
explicit PanelStyleDeps(const PanelStylePatterns& panelStylePatterns) noexcept
: setProperty{panelStylePatterns.setProperty()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/PanoramaImagePanelDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <GameClasses/OffsetTypes/PanoramaImagePanelOffset.h>

struct PanoramaImagePanelDeps {
PanoramaImagePanelDeps() = default;

template <typename PanoramaImagePanelPatterns>
explicit PanoramaImagePanelDeps(const PanoramaImagePanelPatterns& panoramaImagePanelPatterns) noexcept
: setImage{panoramaImagePanelPatterns.setImage()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/PanoramaLabelDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <CS2/Panorama/CLabel.h>

struct PanoramaLabelDeps {
PanoramaLabelDeps() = default;

template <typename PanoramaLabelPatterns>
explicit PanoramaLabelDeps(const PanoramaLabelPatterns& panoramaLabelPatterns) noexcept
: setTextInternal{panoramaLabelPatterns.setTextInternal()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/PanoramaUiEngineDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <CS2/Panorama/CUIEngine.h>

struct PanoramaUiEngineDeps {
PanoramaUiEngineDeps() = default;

template <typename PanoramaUiEnginePatterns>
explicit PanoramaUiEngineDeps(const PanoramaUiEnginePatterns& panoramaUiEnginePatterns) noexcept
: thisptr{panoramaUiEnginePatterns.uiEngine()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/PanoramaUiPanelDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <Utils/FieldOffset.h>

struct PanoramaUiPanelDeps {
PanoramaUiPanelDeps() = default;

template <typename PanoramaUiPanelPatterns>
explicit PanoramaUiPanelDeps(const PanoramaUiPanelPatterns& panoramaUiPanelPatterns) noexcept
: setParent{panoramaUiPanelPatterns.setParent()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/PlantedC4Deps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/PlantedC4Offset.h>

struct PlantedC4Deps {
PlantedC4Deps() = default;

template <typename PlantedC4Patterns>
explicit PlantedC4Deps(const PlantedC4Patterns& plantedC4Patterns) noexcept
: plantedC4s{plantedC4Patterns.plantedC4s()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/PlayerControllerDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/PlayerControllerOffset.h>

struct PlayerControllerDeps {
PlayerControllerDeps() = default;

template <typename PlayerControllerPatterns>
explicit PlayerControllerDeps(const PlayerControllerPatterns& playerControllerPatterns) noexcept
: offsetToPlayerPawnHandle{playerControllerPatterns.offsetToPlayerPawnHandle()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/PlayerPawnDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/PlayerPawnOffset.h>

struct PlayerPawnDeps {
PlayerPawnDeps() = default;

template <typename PlayerPawnPatterns>
explicit PlayerPawnDeps(const PlayerPawnPatterns& playerPawnPatterns) noexcept
: offsetToPlayerPawnImmunity{playerPawnPatterns.offsetToPlayerPawnImmunity()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/RenderComponentDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/RenderComponentOffset.h>

struct RenderComponentDeps {
RenderComponentDeps() = default;

template <typename RenderComponentPatterns>
explicit RenderComponentDeps(const RenderComponentPatterns& renderComponentPatterns) noexcept
: offsetToSceneObjectUpdaters{renderComponentPatterns.offsetToSceneObjectUpdaters()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/SceneObjectDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/SceneObjectOffset.h>

struct SceneObjectDeps {
SceneObjectDeps() = default;

template <typename SceneObjectPatterns>
explicit SceneObjectDeps(const SceneObjectPatterns& sceneObjectPatterns) noexcept
: offsetToFlags{sceneObjectPatterns.offsetToSceneObjectFlags()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/SceneObjectUpdaterDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/SceneObjectUpdaterOffset.h>

struct SceneObjectUpdaterDeps {
SceneObjectUpdaterDeps() = default;

template <typename SceneObjectUpdaterPatterns>
explicit SceneObjectUpdaterDeps(const SceneObjectUpdaterPatterns& sceneObjectUpdaterPatterns) noexcept
: offsetToSceneObject{sceneObjectUpdaterPatterns.offsetToSceneObject()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/SceneSystemDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <CS2/Classes/CSceneSystem.h>

struct SceneSystemDeps {
SceneSystemDeps() = default;

template <typename SceneSystemPatterns>
explicit SceneSystemDeps(const SceneSystemPatterns& sceneSystemPatterns) noexcept
: sceneSystem{sceneSystemPatterns.sceneSystem()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/SmokeGrenadeProjectileDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/SmokeGrenadeProjectileOffset.h>

struct SmokeGrenadeProjectileDeps {
SmokeGrenadeProjectileDeps() = default;

template <typename SmokeGrenadeProjectilePatterns>
explicit SmokeGrenadeProjectileDeps(const SmokeGrenadeProjectilePatterns& smokeGrenadeProjectilePatterns) noexcept
: offsetToDidSmokeEffect{smokeGrenadeProjectilePatterns.offsetToDidSmokeEffect()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/TopLevelWindowDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/TopLevelWindowOffset.h>

struct TopLevelWindowDeps {
TopLevelWindowDeps() = default;

template <typename TopLevelWindowPatterns>
explicit TopLevelWindowDeps(const TopLevelWindowPatterns& topLevelWindowPatterns) noexcept
: uiScaleFactorOffset{topLevelWindowPatterns.uiScaleFactorOffset()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/WeaponDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/WeaponOffset.h>

struct WeaponDeps {
WeaponDeps() = default;

template <typename WeaponPatterns>
explicit WeaponDeps(const WeaponPatterns& weaponPatterns) noexcept
: offsetToClipAmmo{weaponPatterns.offsetToClipAmmo()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/WeaponServicesDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/WeaponServicesOffset.h>

struct WeaponServicesDeps {
WeaponServicesDeps() = default;

template <typename WeaponServicesPatterns>
explicit WeaponServicesDeps(const WeaponServicesPatterns& weaponServicesPatterns) noexcept
: offsetToActiveWeapon{weaponServicesPatterns.offsetToActiveWeapon()}
Expand Down
2 changes: 2 additions & 0 deletions Source/GameDependencies/WeaponVDataDeps.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <GameClasses/OffsetTypes/WeaponVDataOffset.h>

struct WeaponVDataDeps {
WeaponVDataDeps() = default;

template <typename WeaponVDataPatterns>
explicit WeaponVDataDeps(const WeaponVDataPatterns& weaponVDataPatterns) noexcept
: offsetToWeaponName{weaponVDataPatterns.offsetToWeaponName()}
Expand Down

0 comments on commit 2f6fca5

Please sign in to comment.