358
|
1 |
#ifndef APPLICATION_HH
|
|
2 |
#define APPLIATION_HH
|
|
3 |
|
|
4 |
#include "Engine.hh"
|
|
5 |
#include "Error.hh"
|
|
6 |
|
|
7 |
#include <ClanLib/core.h>
|
|
8 |
#include <ClanLib/application.h>
|
|
9 |
|
|
10 |
class ArgumentError : public Error {
|
|
11 |
public:
|
|
12 |
ArgumentError (const std::string &message) : Error(message) { }
|
|
13 |
};
|
|
14 |
|
|
15 |
/**
|
|
16 |
* Our CL_ClanApplication. Provides our main function, handles argument parsing and interacts with Engine
|
|
17 |
*/
|
|
18 |
class Main : public CL_ClanApplication {
|
|
19 |
private:
|
|
20 |
// arguments
|
|
21 |
CL_CommandLine args;
|
|
22 |
|
|
23 |
/**
|
|
24 |
* --graphics
|
|
25 |
*/
|
|
26 |
bool arg_graphics;
|
|
27 |
|
|
28 |
/**
|
|
29 |
* --port
|
|
30 |
*/
|
|
31 |
std::string arg_port;
|
|
32 |
|
|
33 |
/**
|
|
34 |
* --server
|
|
35 |
*/
|
|
36 |
bool arg_server;
|
|
37 |
|
|
38 |
/**
|
|
39 |
* --connect
|
|
40 |
*/
|
|
41 |
std::string arg_connect;
|
|
42 |
|
|
43 |
/**
|
|
44 |
* Set the arg_* members
|
|
45 |
*/
|
|
46 |
void parse_args (int argc, char **argv);
|
|
47 |
|
|
48 |
public:
|
|
49 |
/**
|
|
50 |
* IT BEGAN IN AFRIKA
|
|
51 |
*/
|
|
52 |
virtual int main (int argc, char **argv);
|
|
53 |
} app;
|
|
54 |
|
|
55 |
#endif
|