gremlin/src/common/Application.h

51 lines
774 B
C
Raw Normal View History

2011-01-14 14:59:18 +01:00
#ifndef APPLICATION_H_
#define APPLICATION_H_
2011-01-18 23:31:41 +01:00
#include "sigslot.h"
#include "common.h"
2011-01-14 14:59:18 +01:00
2011-01-18 23:31:41 +01:00
#include "Game.h"
2011-01-14 14:59:18 +01:00
#include "Schedule.h"
2011-01-16 23:02:40 +01:00
#include "Network.h"
2018-11-26 13:15:41 +01:00
#include "Config.h"
namespace gln {
2011-01-14 14:59:18 +01:00
2011-01-18 23:31:41 +01:00
class Application: public sigslot::has_slots<> {
2011-01-14 14:59:18 +01:00
public:
Application();
virtual ~Application();
2018-11-26 13:15:41 +01:00
virtual void initialize(Config &config);
2011-01-14 14:59:18 +01:00
virtual void update();
virtual void shutdown();
bool isRunning();
virtual void start();
virtual void stop();
inline bool isMaster() {
return master;
}
void setMaster(bool master);
2011-01-18 21:52:05 +01:00
inline Game *getGame() {
2011-01-14 14:59:18 +01:00
return &game;
}
private:
bool running;
double lastTime;
Schedule gameUpdateSchudule;
bool master;
protected:
2011-01-18 21:52:05 +01:00
Game game;
2011-01-16 23:02:40 +01:00
Network network;
2011-01-14 14:59:18 +01:00
double dt;
double time;
};
2018-11-26 13:15:41 +01:00
} // namespace grln
2011-01-14 14:59:18 +01:00
#endif /* APPLICATION_H_ */