implement simulation shell
This commit is contained in:
38
src/lib/sim/Simulation.cpp
Normal file
38
src/lib/sim/Simulation.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "Simulation.h"
|
||||
|
||||
Simulation::Simulation(const GameConfig& config, unsigned int seed)
|
||||
: m_config(config)
|
||||
, m_rng(seed)
|
||||
, m_currentTick(0)
|
||||
, m_nextId(1)
|
||||
{
|
||||
}
|
||||
|
||||
void Simulation::tick()
|
||||
{
|
||||
++m_currentTick;
|
||||
}
|
||||
|
||||
std::vector<FireEvent> Simulation::drainFireEvents()
|
||||
{
|
||||
std::vector<FireEvent> result;
|
||||
result.swap(m_fireEvents);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<BlueprintDropEvent> Simulation::drainBlueprintDropEvents()
|
||||
{
|
||||
std::vector<BlueprintDropEvent> result;
|
||||
result.swap(m_blueprintDropEvents);
|
||||
return result;
|
||||
}
|
||||
|
||||
Tick Simulation::currentTick() const
|
||||
{
|
||||
return m_currentTick;
|
||||
}
|
||||
|
||||
EntityId Simulation::allocateId()
|
||||
{
|
||||
return m_nextId++;
|
||||
}
|
||||
Reference in New Issue
Block a user