implement simulation shell
This commit is contained in:
41
src/lib/sim/Simulation.h
Normal file
41
src/lib/sim/Simulation.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
#include <random>
|
||||
#include <vector>
|
||||
|
||||
#include "EntityId.h"
|
||||
#include "FireEvent.h"
|
||||
#include "BlueprintDropEvent.h"
|
||||
#include "GameConfig.h"
|
||||
#include "Tick.h"
|
||||
|
||||
class Simulation
|
||||
{
|
||||
public:
|
||||
explicit Simulation(const GameConfig& config, unsigned int seed = 0);
|
||||
|
||||
// Advances the simulation by one tick. Tick order per architecture.md §Tick Order.
|
||||
// Currently a stub; subsystems are plugged in across Steps 3-7.
|
||||
void tick();
|
||||
|
||||
// Returns all fire events accumulated since the last drain, clearing the
|
||||
// internal queue. Call once per rendered frame (REQ-SHP-FIRING-BEAM).
|
||||
std::vector<FireEvent> drainFireEvents();
|
||||
|
||||
// Returns all blueprint drop events since the last drain.
|
||||
std::vector<BlueprintDropEvent> drainBlueprintDropEvents();
|
||||
|
||||
Tick currentTick() const;
|
||||
|
||||
private:
|
||||
EntityId allocateId(); // Strictly increasing; never returns kInvalidEntityId.
|
||||
|
||||
const GameConfig& m_config;
|
||||
std::mt19937 m_rng;
|
||||
|
||||
Tick m_currentTick;
|
||||
EntityId m_nextId; // starts at 1; 0 is kInvalidEntityId.
|
||||
|
||||
std::vector<FireEvent> m_fireEvents;
|
||||
std::vector<BlueprintDropEvent> m_blueprintDropEvents;
|
||||
};
|
||||
Reference in New Issue
Block a user