VoxelEngine/src/logic/BlocksController.h
MihailRis acce49f188
Scripting WIP (#70)
* Scripting introduced

* AppImage workflow fixes

* AppImage workflow simplified

* README.md update

* README.md update

* small fix
2023-12-25 05:26:03 +03:00

47 lines
894 B
C++

#ifndef LOGIC_BLOCKS_CONTROLLER_H_
#define LOGIC_BLOCKS_CONTROLLER_H_
#include "../typedefs.h"
class Player;
class Block;
class Level;
class Chunks;
class Lighting;
class Clock {
int tickRate;
int tickParts;
float tickTimer = 0.0f;
int tickId = 0;
int tickPartsUndone = 0;
public:
Clock(int tickRate, int tickParts);
bool update(float delta);
int getParts() const;
int getPart() const;
};
class BlocksController {
Level* level;
Chunks* chunks;
Lighting* lighting;
Clock randTickClock;
uint padding;
public:
BlocksController(Level* level, uint padding);
void updateSides(int x, int y, int z);
void updateBlock(int x, int y, int z);
void breakBlock(Player* player, const Block* def, int x, int y, int z);
void update(float delta);
void randomTick(int tickid, int parts);
};
#endif // LOGIC_BLOCKS_CONTROLLER_H_