Mercurial > LightClone
diff LightClone/Source/World.h @ 9:e494c4295dba
Conversion to World architecture
author | koryspansel |
---|---|
date | Fri, 09 Sep 2011 18:36:18 -0700 |
parents | 968341ab1fb2 |
children | 292e534f00c2 |
line wrap: on
line diff
--- a/LightClone/Source/World.h Fri Sep 09 16:18:41 2011 -0700 +++ b/LightClone/Source/World.h Fri Sep 09 18:36:18 2011 -0700 @@ -6,6 +6,18 @@ #define __WORLD_H__ #include "Core.h" +#include "RenderContext.h" +#include "Environment.h" +#include "Bot.h" +#include "Code.h" +#include "Loader.h" +#include "CameraController.h" +#include "DragController.h" +#include "ResourceManager.h" +#include "InputManager.h" +#include "ButtonPane.h" +#include "Dialog.h" +#include "Interface.h" /* * World @@ -13,27 +25,123 @@ class World { /* + * pInputManager + */ + InputManager* pInputManager; + + /* + * kLoader + */ + Loader kLoader; + + /* * kEnvironment - * The environment is the grid on which the bot is placed and with which it interacts */ - //Environment kEnvironment; + Environment kEnvironment; /* * kBot - * Represents the robot programmed to solve the challenges + */ + Bot kBot; + + /* + * kFunction + */ + Code* pFunction; + + /* + * nGameState + */ + uint32 nGameState; + + /* + * nSimulationState + */ + uint32 nSimulationState; + + /* + * nCurrentLevel */ - //Bot kBot; + uint32 nCurrentLevel; + + /* + * nCurrentFunction + */ + uint32 nCurrentFunction; + + /* + * kCameraController + */ + CameraController kCameraController; + + /* + * kDragController + */ + DragController kDragController; + + /* + * kToolbar + */ + ButtonPane kToolbar; /* - * kProgram - * Stores the current program being edited by the player + * kMain + */ + ButtonPane kMain; + + /* + * kFunction + */ + ButtonPane kFunction; + + /* + * kControlBounds + */ + ButtonPane kControls; + + /* + * kArrowBounds + */ + Rectangle2 kArrowBounds[2]; + + /* + * kDialog1Bounds */ + Rectangle2 kDialog1Bounds[1]; + + /* + * kDialog2Bounds + */ + Rectangle2 kDialog2Bounds[2]; + + /* + * pBlockEffect + * Move to World + */ + ID3DXEffect* pBlockEffect; + + /* + * pBlockVertexBuffer + * Move to World + */ + IDirect3DVertexBuffer9* pBlockVertexBuffer; + + /* + * pBlockTexture + * Move to World + */ + IDirect3DTexture9* pBlockTexture; /* * kInterface - * Manages the tree of UI elements + * Move to World */ - //Interface kInterface; + Interface kInterface; + + /* + * kDialog + */ + Dialog kDialog; public: @@ -45,7 +153,7 @@ /* * Initialize */ - ErrorCode Initialize(); + ErrorCode Initialize(ResourceManager* pResource, InputManager* pInput); /* * Terminate @@ -53,6 +161,41 @@ void Terminate(); /* + * Activate + */ + void Activate(); + + /* + * Deactivate + */ + void Deactivate(); + + /* + * IsActive + */ + bool IsActive(); + + /* + * Load + */ + bool Load(const char* pName); + + /* + * ResetEnvironment + */ + void ResetEnvironment(); + + /* + * ResetBot + */ + void ResetBot(); + + /* + * ResetCode + */ + void ClearCode(); + + /* * Update */ void Update(float fElapsed); @@ -60,7 +203,39 @@ /* * Render */ - void Render(); + void Render(RenderContext& kContext); + +private: + + /* + * SetupVertexBuffer + */ + ErrorCode SetupVertexBuffer(); + + /* + * Render3D + */ + void Render3D(RenderContext& kContext); + + /* + * Render2D + */ + void Render2D(RenderContext& kContext); + + /* + * RenderEnvironment + */ + void RenderEnvironment(RenderContext& kContext, Environment* pEnvironment); + + /* + * RenderBot + */ + void RenderBot(RenderContext& kContext, Environment* pEnvironment, Bot* pBot); + + /* + * ProcessInput + */ + void ProcessInput(float fElapsed); }; #endif //__WORLD_H__