#pragma once
#include <cstdint>
#include "Offsets.h"

// ---------------------------------------------------------------------------
// RuntimeOffsets
//
// Mutable counterparts to the compile-time Offsets:: namespace.
// SigScanner::Apply() updates these at startup from scanned byte patterns.
// All memory readers use RuntimeOffsets:: so a single scanner run covers a
// game patch without needing a recompile.
//
// Defaults are the last-known good values from Offsets.h; the scanner will
// overwrite them when matching patterns are found in the game binary.
// ---------------------------------------------------------------------------
namespace RuntimeOffsets {

    // -----------------------------------------------------------------------
    // Base — module-relative RVAs of global variables
    // (resolved via RIP-relative MOV/LEA, ScanType::MovCs)
    // -----------------------------------------------------------------------
    namespace Base {
        inline uint64_t World          = Offsets::Base::World;
        inline uint64_t NetworkManager = Offsets::Base::NetworkManager;
    }

    // -----------------------------------------------------------------------
    // World — struct member offsets within the World object
    // (resolved via MOV reg, [reg+offset], ScanType::MovReg)
    // -----------------------------------------------------------------------
    namespace World {
        inline uint64_t NearEntityList      = Offsets::World::NearEntityList;
        inline uint64_t NearTableSize       = Offsets::World::NearTableSize;
        inline uint64_t FarEntityList       = Offsets::World::FarEntityList;
        inline uint64_t FarTableSize        = Offsets::World::FarTableSize;
        inline uint64_t BulletTable         = Offsets::World::BulletTable;
        inline uint64_t BulletCount         = Offsets::World::BulletCount;
        inline uint64_t Camera              = Offsets::World::Camera;
        inline uint64_t ItemList            = Offsets::World::ItemList;
        inline uint64_t ItemTableAllocCount = Offsets::World::ItemTableAllocCount;
        inline uint64_t ItemTableValidCount = Offsets::World::ItemTableValidCount;
    }

    // -----------------------------------------------------------------------
    // Entity / common struct offsets
    // -----------------------------------------------------------------------
    namespace Common {
        inline uint64_t VisualState = Offsets::Common::VisualState;
    }

    namespace Player {
        inline uint64_t IsDead = Offsets::Player::IsDead;
    }

    namespace Inventory {
        inline uint64_t Base  = Offsets::Inventory::Base;
        inline uint64_t Hands = Offsets::Inventory::Hands;
    }

} // namespace RuntimeOffsets
