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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 95 additions and 39 deletions

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;

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_ */

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_ */

View file

@ -1,4 +1,7 @@
#include "WorldGenerator.h"
#include "voxel.h"
#include "Chunk.h"
#include "Block.h"
#include "../content/Content.h"

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_ */