feat: World.SetBlock writes through to IChunkModificationStore

This commit is contained in:
2026-06-01 10:29:01 +02:00
parent 7c310ebc6a
commit 6a68953c9a
4 changed files with 149 additions and 40 deletions

View File

@@ -6,6 +6,7 @@ using OpenTK.Windowing.GraphicsLibraryFramework;
using VoxelEngine.Rendering;
using VoxelEngine.World.Blocks;
using VoxelEngine.World.Chunk;
using VoxelEngine.World.Persistence;
using VoxelEngine.World.WorldGen;
namespace VoxelEngine.Core;
@@ -15,7 +16,7 @@ public sealed class Game : GameWindow
private const float MoveSpeed = 8f; // units per second
private const float Sensitivity = 0.15f; // degrees per pixel
private const int Seed = 1337;
private const bool UseSeed = false;
private const bool UseSeed = false;
private readonly BlockRegistry _registry = new();
private Shader _shader = null!;
@@ -40,7 +41,7 @@ public sealed class Game : GameWindow
this._shader = new Shader("Assets/shaders/chunk.vert", "Assets/shaders/chunk.frag");
this._texture = new Texture("Assets/textures/VoxelShadeAtlas.png");
this._world = new World.World(this._registry);
this._world = new World.World(this._registry, new InMemoryChunkModificationStore());
int seed = Game.UseSeed ? Game.Seed : new Random().Next();