Add files via upload

This commit is contained in:
Onran
2024-02-23 17:12:00 +09:00
committed by GitHub
parent a5087cf221
commit 8130b0626f
17 changed files with 95 additions and 39 deletions
+1 -2
View File
@@ -1,5 +1,4 @@
#include "DefaultWorldGenerator.h"
#include "WorldGenerator.h"
#include "voxel.h"
#include "Chunk.h"
#include "Block.h"
@@ -120,7 +119,7 @@ int generate_tree(fnl_state *noise,
return 0;
}
void WorldGenerator::generate(voxel* voxels, int cx, int cz, int seed){
void DefaultWorldGenerator::generate(voxel* voxels, int cx, int cz, int seed){
const int treesTile = 12;
fnl_state noise = fnlCreateState();
noise.noise_type = FNL_NOISE_OPENSIMPLEX2;
+5 -5
View File
@@ -1,18 +1,18 @@
#ifndef VOXELS_WORLDGENERATOR_H_
#define VOXELS_WORLDGENERATOR_H_
#ifndef VOXELS_DEFAULTWORLDGENERATOR_H_
#define VOXELS_DEFAULTWORLDGENERATOR_H_
#include "../typedefs.h"
#include "../voxels/WorldGenerator.h"
#include <string>
struct voxel;
class Content;
class DefaultWorldGenerator : WorldGenerator {
public:
DefaultWorldGenerator(const Content* content) : WorldGenerator(content) {}
void generate(voxel* voxels, int x, int z, int seed) override;
void generate(voxel* voxels, int x, int z, int seed);
};
#endif /* VOXELS_WORLDGENERATOR_H_ */
#endif /* VOXELS_DEFAULTWORLDGENERATOR_H_ */
+1 -1
View File
@@ -12,7 +12,7 @@ public:
FlatWorldGenerator(const Content* content) : WorldGenerator(content) {}
void generate(voxel* voxels, int x, int z, int seed) override;
void generate(voxel* voxels, int x, int z, int seed);
};
#endif /* VOXELS_FLATWORLDGENERATOR_H_ */
+3
View File
@@ -1,4 +1,7 @@
#include "WorldGenerator.h"
#include "voxel.h"
#include "Chunk.h"
#include "Block.h"
#include "../content/Content.h"
+1 -1
View File
@@ -22,7 +22,7 @@ protected:
public:
WorldGenerator(const Content* content);
virtual void generate(voxel* voxels, int x, int z, int seed);
virtual void generate(voxel* voxels, int x, int z, int seed) = 0;
};
#endif /* VOXELS_WORLDGENERATOR_H_ */