Show loadstate.h syntax highlighted
/***************************************************************************
loadstate.h
-------------------
begin : Thu Feb 3 2005
copyright : (C) 2005 by Brendon Lloyd Higgins
email : bh_doc@users.sourceforge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef LOADSTATE_H_INCLUDED
#define LOADSTATE_H_INCLUDED
#include <clientstate.h>
#include <connectstate.h>
#include <ClanLib/network.h>
class Rules;
class WorldClient;
class CL_ProgressBar;
/**
* This state handles reading the gamestate from the server and loading the
* sprites for the client.
*/
class LoadState: public ClientState {
public:
/**
* Constructor.
*/
LoadState(CL_NetSession* ns, const CL_NetComputer& s,
const CL_NetStream& i, PlayerList* p, PlayerClient* m);
/**
* Destructor.
*/
virtual ~LoadState();
virtual ClientState* go(Client* client);
private:
/**
* Load the sprites, and draw a pretty progress dialog.
*/
void loadSprites(Rules* rules);
/**
* Callback to redraw the dialog at each interval of sprite loading.
*/
void loadSpritesCallback(int stage, CL_ProgressBar* pb);
/**
* The current net session.
*/
CL_NetSession* netsession;
/**
* The server.
*/
CL_NetComputer server;
/**
* The stream to receive game state data over.
*/
CL_NetStream* startInput;
/**
* The list of players.
*/
PlayerList* players;
/**
* The local player.
*/
PlayerClient* me;
};
#endif /* ndef LOADSTATE_H_INCLUDED */
See more files for this project here