Code Search for Developers
 
 
  

loadstate.h from FreePop at Krugle


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

FreePop

FreePop is a multi-platform tile-based game based on the great old game Populous 2 by Bullfrog Productions Ltd., but much improved.

Project homepage: http://sourceforge.net/projects/freepop
Programming language(s): C++
License: other

  Makefile.am
  client.cpp
  client.h
  clientmisc.cpp
  clientmisc.h
  clientstate.cpp
  clientstate.h
  connectstate.cpp
  connectstate.h
  cropsclient.cpp
  cropsclient.h
  entityclient.cpp
  entityclient.h
  entityclientfactory.cpp
  entityclientfactory.h
  firecolumnclient.cpp
  firecolumnclient.h
  gamestate.cpp
  gamestate.h
  loadstate.cpp
  loadstate.h
  mapclient.cpp
  mapclient.h
  maptileclient.cpp
  maptileclient.h
  messagebox.cpp
  messagebox.h
  oversprite.cpp
  oversprite.h
  paintable.cpp
  paintable.h
  pausefader.cpp
  pausefader.h
  peepclient.cpp
  peepclient.h
  peepmagnetclient.cpp
  peepmagnetclient.h
  playerclient.cpp
  playerclient.h
  playeroptionsdialog.cpp
  playeroptionsdialog.h
  rockclient.cpp
  rockclient.h
  swampclient.cpp
  swampclient.h
  townclient.cpp
  townclient.h
  treeclient.cpp
  treeclient.h
  worldclient.cpp
  worldclient.h