Initial commit.

This commit is contained in:
Mike Bostock 2012-12-14 09:47:48 -08:00
commit 44b5f2392f
98 changed files with 11750 additions and 0 deletions

34
simulation.h Normal file
View file

@ -0,0 +1,34 @@
// -*- C++ -*-
#ifndef MBOSTOCK_SIMULATION_H
#define MBOSTOCK_SIMULATION_H
#include <stdint.h>
namespace mbostock {
class Simulation {
public:
Simulation(uint32_t timeStepMs);
virtual ~Simulation() {}
virtual void togglePaused();
inline bool paused() const { return paused_; }
void simulate();
protected:
virtual void step() = 0;
private:
uint32_t elapsedMillis();
uint32_t timeStepMs_;
uint32_t skippedMs_;
uint32_t lastTimeMs_;
bool paused_;
};
}
#endif