25 lines
690 B
C++
25 lines
690 B
C++
#pragma once
|
|
|
|
#include "engine.h"
|
|
#include "transmission.h"
|
|
#include "vehicle.h"
|
|
|
|
// Owns Engine + Transmission + Vehicle and sequences the per-tick
|
|
// coupling between them. This is the thing main.cpp / the GUI talks to.
|
|
class Simulation {
|
|
public:
|
|
void step(double dt);
|
|
|
|
const Engine& engine() const { return m_engine; }
|
|
const Transmission& transmission() const { return m_transmission; }
|
|
const Vehicle& vehicle() const { return m_vehicle; }
|
|
|
|
Engine& engine() { return m_engine; } // for reset, etc.
|
|
Transmission& transmission() { return m_transmission; } // for gear shifts
|
|
|
|
private:
|
|
Engine m_engine;
|
|
Transmission m_transmission;
|
|
Vehicle m_vehicle;
|
|
};
|