view LightClone/Source/Environment.h @ 18:33cb6979ac51

More work on GUI system
author koryspansel
date Wed, 14 Sep 2011 17:24:49 -0700
parents 292e534f00c2
children 5656c8e382fc
line wrap: on
line source

/*
 * Environment
 */

#ifndef __ENVIRONMENT_H__
#define __ENVIRONMENT_H__

#include "Core.h"
#include "Tower.h"
#include "RenderContext.h"
#include "ResourceManager.h"

/*
 * Environment
 */
class Environment
{
	/*
	 * pBlockEffect
	 */
	ID3DXEffect* pBlockEffect;

	/*
	 * pBlockVertexBuffer
	 */
	IDirect3DVertexBuffer9* pBlockVertexBuffer;

	/*
	 * pBlockTexture
	 */
	IDirect3DTexture9* pBlockTexture;

	/*
	 * nWidth
	 */
	uint32 nWidth;

	/*
	 * nHeight
	 */
	uint32 nHeight;

	/*
	 * kScale
	 */
	D3DXVECTOR3 kScale;

	/*
	 * pGrid
	 */
	Tower* pGrid;

public:

	/*
	 * Environment
	 */
	Environment();

	/*
	 * ~Environment
	 */
	~Environment();

	/*
	 * Initialize
	 */
	ErrorCode Initialize(ResourceManager* pResourceManager);

	/*
	 * Terminate
	 */
	void Terminate();

	/*
	 * Setup
	 */
	ErrorCode Setup(uint32 nGridWidth, uint32 nGridHeight);

	/*
	 * Reset
	 */
	void Reset();

	/*
	 * Update
	 */
	void Update(float fElapsed);

	/*
	 * Render
	 */
	void Render(RenderContext& kContext, Camera& kCamera);

	/*
	 * GetWidth
	 */
	uint32 GetWidth() const;

	/*
	 * GetHeight
	 */
	uint32 GetHeight() const;

	/*
	 * GetScale
	 */
	const D3DXVECTOR3& GetScale() const;

	/*
	 * SetType
	 */
	void SetType(uint32 nX, uint32 nY, uint32 nType);

	/*
	 * GetType
	 */
	uint32 GetType(uint32 nX, uint32 nY) const;

	/*
	 * SetAltitude
	 */
	void SetAltitude(uint32 nX, uint32 nY, uint32 nHeight);

	/*
	 * GetAltitude
	 */
	uint32 GetAltitude(uint32 nX, uint32 nY) const;

	/*
	 * GetState
	 */
	uint32 GetState(uint32 nX, uint32 nY) const;

	/*
	 * IsMovementValid
	 */
	bool IsMovementValid(uint32 nAction, uint32 nX, uint32 nY, uint32 nDirection);

	/*
	 * RequirementsMet
	 *	Used to determine if the requirements for completing a 
	 *  given map have been satisfied.
	 */
	bool RequirementsMet() const;

	/*
	 * NotifyAction
	 *	Used by objects to notify the environment of changes
	 */
	void NotifyAction(uint32 nX, uint32 nY);

private:

	/*
	 * SetupVertexBuffer
	 */
	ErrorCode SetupVertexBuffer();
};

#endif //__ENVIRONMENT_H__