src/GameState.hh
author terom
Mon, 15 Dec 2008 14:34:14 +0000
changeset 372 a03d7d716dd9
parent 274 c35307e8645c
child 393 5dd4d782cf3a
permissions -rw-r--r--
remove redundant doc/doxygen directory
#ifndef GAMESTATE_HH
#define GAMESTATE_HH

class GameState;

#include "PhysicsWorld.hh"
#include "Player.hh"
#include "Projectile.hh"
#include "Rope.hh"
#include "Input.hh"
#include "GraphicsPointer.hh"
#include "Config.hh"

#include <list>
#include <stdexcept>
#include <cmath>

class GameState {
public:
    std::list<Player*> player_list;
    std::list<Projectile*> projectiles;
    PhysicsWorld world;

    /**
     * The one LocalPlayer that *we* control
     */
    LocalPlayer *local_player;
    
    /**
     * ...
     * 
     * This should take some arguments
     */
    GameState (void);
    
    /**
     * Adds projectile to our list of projectiles to draw
     */
    void addProjectile(Projectile *projectile);

    /**
     * Get our current LocalPlayer if we have one, else return NULL (client hasn't connected yet)
     */
    LocalPlayer *getLocalPlayer (void);
    
    /**
     * Check that local_player is NULL, and sets it to the given player
     */
    void setLocalPlayer (LocalPlayer *player);        

    /**
     * Add the given player to our player_list
     */
    void addPlayer (Player *player);
    
    /**
     * Removes the given player from player_list. If the given player was the local_player, set that to NULL
     */
    void removePlayer (Player *player);
    
    /**
     * Draws the terrain, players and projectiles
     */
    virtual void draw (Graphics *g, PixelCoordinate camera, bool displayWeapon);
};

#endif