2022-10-30 23:19:35 +01:00
|
|
|
#ifndef MAPBLOCK
|
|
|
|
#define MAPBLOCK
|
2022-10-22 17:03:43 +02:00
|
|
|
#include "Base.h"
|
2022-10-23 23:44:58 +02:00
|
|
|
#include <math.h>
|
2022-10-30 20:43:20 +01:00
|
|
|
#include <cstdio>
|
2022-10-23 23:44:58 +02:00
|
|
|
|
2022-10-30 16:53:41 +01:00
|
|
|
class MapBlock
|
2022-10-22 17:03:43 +02:00
|
|
|
{
|
|
|
|
public:
|
2022-10-30 17:56:14 +01:00
|
|
|
int mapBlock[65536];
|
2022-10-30 23:19:35 +01:00
|
|
|
MapBlock();
|
|
|
|
// TODO; Make this function work with global coordinates and move it to BlockManager
|
|
|
|
void addNode(int id, int meta, int x, int y, int z);
|
2022-10-30 17:56:14 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2022-10-30 23:19:35 +01:00
|
|
|
class BlockManager
|
2022-10-30 17:56:14 +01:00
|
|
|
{
|
|
|
|
public:
|
2022-10-30 23:19:35 +01:00
|
|
|
MapBlock mapBlocks[16][16];
|
|
|
|
BlockManager();
|
|
|
|
int getNodeAt(int x, int y, int z);
|
|
|
|
bool isAir(int x, int y, int z);
|
2022-10-22 17:03:43 +02:00
|
|
|
};
|
|
|
|
|
2022-10-30 23:19:35 +01:00
|
|
|
class BlockUtilities
|
2022-10-23 23:44:58 +02:00
|
|
|
{
|
2022-10-26 23:13:48 +02:00
|
|
|
public:
|
2022-10-30 23:19:35 +01:00
|
|
|
BlockUtilities();
|
|
|
|
static Position2D getBlockFromNodeCoordinates(int x, int z);
|
2022-10-30 17:56:14 +01:00
|
|
|
};
|
2022-10-23 23:44:58 +02:00
|
|
|
|
2022-10-22 17:03:43 +02:00
|
|
|
#endif
|