#pragma once

#include <d3dx9.h>

#include "Direct3D.h"
#include "3DObject.h"
#include "Camera.h"
#include "Cube.h"
#include "Laser.h"

typedef struct 
{
	int tileX, tileY;
} CubePos;

class SkyDome : public C3DObject
{
	CDirect3D *d3d;
	CCamera *camera;
	LPDIRECT3DTEXTURE9 g_pSky; 

public:

	SkyDome(CDirect3D *d3d, CCamera *c);
	virtual void  Render() override;
};

class CGround : public C3DObject
{
	int tilesX, tilesY;
	float tileSize;
	float posZ;
    
	CCube ** cubes;
	CubePos * cubePosition;
	int cubeCount;

//сделать нормально
	float maxY;
	int diff;

	CDirect3D *d3d;
	LPDIRECT3DTEXTURE9 g_pConcrete; 

// небо
	CCamera *camera;
	SkyDome *skyDome;

public:
	CGround(CDirect3D *d3d, CCamera *c);

	//сделать нормально
	void  MoveGround(CCamera *c);	
	float GetDifference();
	void  ZeroDifference();
	
	void  Translate(float x, float y, float z);
	bool  ColisionDetection(C3DObject *obj);
	bool  LaserShot(CLaser *obj);
	
	virtual void  Render() override;
public:
	~CGround(void);
};
