00001 #ifndef _WORLD_H_ 00002 #define _WORLD_H_ 00003 00004 #include <sstream> 00005 using namespace std; 00006 00007 #include "SDL_net.h" 00008 #include "tcputil.h" 00009 00010 #include "Actor.h" 00011 #include "AnimationTypes.h" 00012 #include "BackgroundMusic.h" 00013 #include "Camera.h" 00014 #include "Config.h" 00015 #include "Hud.h" 00016 #include "Human.h" 00017 #include "InventoryScreen.h" 00018 #include "LocalWorld.h" 00019 #include "Object.h" 00020 #include "ObjLoader.h" 00021 #include "SkyBox.h" 00022 #include "Terrain.h" 00023 00030 class World : public Object 00031 { 00032 public: 00033 World(); 00034 World(TCPsocket st, SDLNet_SocketSet s); 00035 virtual ~World(); 00036 00037 virtual void draw(); 00038 virtual void update(SDL_Event event); 00039 00040 Terrain *getTerrain() { return _terrain; } 00041 vector < Actor * > getAllActors() { return _actors; } 00042 void addHuman(string s); 00043 void keyPressed(unsigned char c) { if (_chatting) _hud->addChat(c); } 00044 void removeKeyPress() { _hud->popChat(); } 00045 00046 protected: 00047 void init(); 00048 Object *checkCollision(Vector3 position, double radius = 0.0); 00049 00050 BackgroundMusic *_bm; 00051 Camera *_camera; // holds the camera 00052 Hud *_hud; 00053 SkyBox *_skyBox; // holds the skybox 00054 Terrain *_terrain; // holds the actual terrain 00055 LocalWorld *_currentTerrain; // holds either the terrain or the building we are inside 00056 Actor *_mainCharacter; // holds the players character 00057 vector < Actor * > _actors; // hold anything that moves 00058 00059 bool _inAction; 00060 Object *_actionObject; 00061 vector < string > _actions; 00062 00063 TCPsocket _socket; 00064 SDLNet_SocketSet _set; 00065 bool _isOnline; 00066 bool _chatting; 00067 00068 bool _inInventory; 00069 InventoryScreen *_inventoryScreen; 00070 }; 00071 00072 #endif