src/StateSailing.h

Go to the documentation of this file.
00001 /* Crown and Cutlass
00002  * Sailing GameState Header
00003  */
00004 
00005 #if !defined( _SAILINGSTATE_H_ )
00006 
00007 #define _SAILINGSTATE_H_
00008 
00009 #include <guichan.hpp>
00010 #include <guichan/sdl.hpp>
00011 #include <guichan/opengl.hpp>
00012 #include "SDL.h"
00013 #include "GLee.h"
00014 #include "IGameState.h"
00015 #include "ISaveObject.h"
00016 
00017 // So I don't have to include the headers
00018 class Terrain;
00019 class Ocean;
00020 class Camera;
00021 class Map;
00022 class CityManager;
00023 class Economy;
00024 class StateCity;
00025 class TiXmlElement;
00026 class EconomyScreen;
00027 
00028 class StateSailing: public IGameState, public ISaveObject {
00029  public:
00030   // Constructor
00031   StateSailing(const std::string playerName, const std::string shipName);
00032 
00033   // Decontructor
00034   ~StateSailing();
00035 
00036   // Reset the game, used when "New Game" is chosen from the menu
00037   void NewGame(const std::string playerName, const std::string shipName);
00038 
00039   // From SaveObject
00040   void Save(TiXmlElement *parent);
00041   void Load(TiXmlElement *parent);
00042 
00043   // Need to implement the Update and Display functions
00044   void Update(const unsigned int ticks);
00045   void Display();
00046 
00047   // Need to implement the switchTo function
00048   void SwitchTo(IGameState *oldState);
00049 
00050   // Need to implement the switchFrom function
00051   void SwitchFrom();
00052 
00053   // Dump some debug info
00054   void Dump();
00055 
00056   // City Manager - Needs to be public for Map call
00057   CityManager* m_cities;
00058 
00059 
00060  private:
00061   // Called from the constructor/destructor and by newGame
00062   void Initialize(const std::string playerName, const std::string shipName);
00063   void Destroy();
00064 
00065   // Handles processing SDL events
00066   void CheckInput();
00067 
00068   // Keyboard handler functions
00069   void HandleKeyUp(SDL_keysym* keysym);
00070   void HandleKeyDown(SDL_keysym* keysym);
00071 
00072   // Timer function to handle time-based movement
00073   void Timer(const unsigned int ticks);
00074 
00075   void SetTicksToNextBattle();
00076 
00077   int m_ticksToNextBattle;
00078 
00079   // For sway of ship
00080   GLfloat m_rotx;
00081 
00082   // Terrain object
00083   Terrain *m_land;
00084 
00085   // Map Object
00086   Map *m_map;
00087 
00088   // Economy
00089   //Economy* economy;
00090 
00091   // City State
00092   IGameState *m_childState;
00093 
00094   // Camera location
00095   Camera *m_camera;
00096   GLfloat m_cameraX, m_cameraY, m_cameraZ;
00097 
00098   // Light info
00099   GLfloat m_ambientLight[4];
00100   GLfloat m_diffuseLight[4];
00101   GLfloat m_lightPosition[4];
00102 
00103   //CCLabel *m_label;
00104   EconomyScreen *m_es;
00105 
00106   // Font names
00107   static const std::string s_mainFontName;
00108 };
00109 
00110 #endif

Generated on Mon Jan 8 22:34:13 2007 for CrownandCutlass by  doxygen 1.4.7