Added class Level for runtime world stuff
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#include "Level.h"
|
||||
#include "../lighting/Lighting.h"
|
||||
#include "../voxels/ChunksController.h"
|
||||
|
||||
Level::Level(Player* player, Chunks* chunks, PhysicsSolver* physics) :
|
||||
player(player),
|
||||
chunks(chunks),
|
||||
physics(physics) {
|
||||
lighting = new Lighting(chunks);
|
||||
chunksController = new ChunksController(chunks, lighting);
|
||||
}
|
||||
|
||||
Level::~Level(){
|
||||
delete chunks;
|
||||
delete physics;
|
||||
delete player;
|
||||
delete lighting;
|
||||
delete chunksController;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef WORLD_LEVEL_H_
|
||||
#define WORLD_LEVEL_H_
|
||||
|
||||
class Player;
|
||||
class Chunks;
|
||||
class Lighting;
|
||||
class PhysicsSolver;
|
||||
class ChunksController;
|
||||
|
||||
class Level {
|
||||
public:
|
||||
Player* player;
|
||||
Chunks* chunks;
|
||||
PhysicsSolver* physics;
|
||||
Lighting* lighting;
|
||||
ChunksController* chunksController;
|
||||
Level(Player* player, Chunks* chunks, PhysicsSolver* physics);
|
||||
~Level();
|
||||
};
|
||||
|
||||
#endif /* WORLD_LEVEL_H_ */
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
#include "../voxels/Chunk.h"
|
||||
#include "../voxels/Chunks.h"
|
||||
|
||||
World::World(std::string name, std::string directory, Chunks* chunks) : name(name), chunks(chunks) {
|
||||
World::World(std::string name, std::string directory) : name(name) {
|
||||
wfile = new WorldFiles(directory, REGION_VOL * (CHUNK_VOL * 2 + 8));
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -10,9 +10,8 @@ class World {
|
||||
public:
|
||||
std::string name;
|
||||
WorldFiles* wfile;
|
||||
Chunks* chunks;
|
||||
|
||||
World(std::string name, std::string directory, Chunks* chunks);
|
||||
World(std::string name, std::string directory);
|
||||
~World();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user