src/Engine.hh
changeset 409 1a03ff151abc
parent 408 e6cfc44266af
child 411 106aaf6eadfe
equal deleted inserted replaced
408:e6cfc44266af 409:1a03ff151abc
    19         // game state
    19         // game state
    20         Terrain *terrain;
    20         Terrain *terrain;
    21         GameState *game_state;
    21         GameState *game_state;
    22 
    22 
    23         /** Set if setupGraphics has been called */
    23         /** Set if setupGraphics has been called */
    24         const GraphicsConfiguration *graphics_config;
    24         const GraphicsConfig *graphics_config;
    25         
    25         
    26         // Graphics/Input
    26         // Graphics/Input
    27         Graphics *graphics;
    27         Graphics *graphics;
    28 
    28 
    29         // network server/client
    29         // network server/client
    41         // default constructor
    41         // default constructor
    42         Engine (const std::string resource_xml_path = RESOURCE_XML_PATH);
    42         Engine (const std::string resource_xml_path = RESOURCE_XML_PATH);
    43 
    43 
    44         /**
    44         /**
    45          * Setup game world using the given terrain, returning the new GameState
    45          * Setup game world using the given terrain, returning the new GameState
       
    46          *
       
    47          * XXX: fix to return void
    46          */
    48          */
    47         GameState& setupGame (Terrain *terrain);
    49         GameState& setupGame (Terrain *terrain);
    48 
    50 
    49         /**
    51         /**
    50          * Setup default game world using constants from Config.hh
    52          * Setup game world using given terrain configuration
    51          */
    53          */
    52         GameState& setupGame (void);
    54         void setupGame (const TerrainConfig &config);
    53 
    55 
    54         // setup graphics
    56         /**
    55         void setupGraphics (const GraphicsConfiguration &config);
    57          * Enable graphics
       
    58          */
       
    59         void setupGraphics (const GraphicsConfig &config);
    56         
    60         
    57         // set up network server/client
    61         /**
    58         // setting up both of these will lead to odd behaviour :)
    62          * Setup server, must call setupGame first
       
    63          */
    59         void setupNetworkServer (const std::string &listen_port);
    64         void setupNetworkServer (const std::string &listen_port);
       
    65 
       
    66         /**
       
    67          * Setup client, do *not* call setupGame, configuration comes from the server
       
    68          */
    60         void setupNetworkClient (const std::string &connect_host, const std::string &connect_port);
    69         void setupNetworkClient (const std::string &connect_host, const std::string &connect_port);
       
    70 
       
    71         /**
       
    72          * Setup singleplayer, must call setupGame first
       
    73          */
    61 		void setupSinglePlayer (void);
    74 		void setupSinglePlayer (void);
    62         
    75         
    63         /**
    76         /**
    64          * Run the game main loop. This will not return until the game aborts due to an error, or someone calls stop().
    77          * Run the game main loop. This will not return until the game aborts due to an error, or someone calls stop().
    65          */
    78          */