src/proto2/Engine.hh
author terom
Sat, 08 Nov 2008 20:34:14 +0000
changeset 22 b70d30e1b0fe
parent 21 32c6cc55256a
child 23 8d802b573cf0
permissions -rw-r--r--
all the network code is now there, although it doesn't quite work
21
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
     1
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
     2
#include "NetworkServer.hh"
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
     3
#include "NetworkClient.hh"
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
     4
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
     5
class Engine {
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
     6
	private:
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
     7
		// game state
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
     8
		GameState game_state;
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
     9
		
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    10
		// network server/client
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    11
		NetworkServer *net_server;
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    12
		NetworkClient *net_client;
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    13
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    14
		// to exit the mainloop
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    15
		bool is_running;
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    16
		
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    17
		// default constructor
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    18
		Engine (void);
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    19
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    20
	public:
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    21
		static void runNetworkServer (const std::string &listen_port);
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    22
		static void runNetworkClient (const std::string &connect_host, const std::string &connect_port);
22
b70d30e1b0fe all the network code is now there, although it doesn't quite work
terom
parents: 21
diff changeset
    23
		
b70d30e1b0fe all the network code is now there, although it doesn't quite work
terom
parents: 21
diff changeset
    24
		static void log (const std::string &level, const std::string &type, const std::string &message);
b70d30e1b0fe all the network code is now there, although it doesn't quite work
terom
parents: 21
diff changeset
    25
21
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    26
	private:
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    27
		void main_loop (void);
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    28
32c6cc55256a change proto2 network code to use CL_NetSession
terom
parents:
diff changeset
    29
};