/*
 * Application.h
 *
 *  Created on: 14.01.2011
 *      Author: gmueller
 */

#ifndef APPLICATION_H_
#define APPLICATION_H_

#include "game.h"

#include "Schedule.h"
#include "Arguments.h"
#include "Network.h"

class Application {
public:
	Application();
	virtual ~Application();
	virtual void initialize(Arguments &arg);
	virtual void update();
	virtual void shutdown();

	bool isRunning();
	virtual void start();
	virtual void stop();

	inline bool isMaster() {
		return master;
	}
	void setMaster(bool master);

	inline game_t *getGame() {
		return &game;
	}

private:
	bool running;
	double lastTime;
	Schedule gameUpdateSchudule;
	bool master;

protected:
	game_t game;
	Network network;
	double dt;
	double time;
};

#endif /* APPLICATION_H_ */
