Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Seal simple/single storage classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver-makes-code committed Dec 4, 2023
1 parent 5fdbd0d commit 4b12d7a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Common/World/Generation/SimpleGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public static void GenerateChunk(Chunk target) {
var density = noise[i];

if (density < 0)
storage[i] = Blocks.Stone;
storage.SetBlock(Blocks.Stone, i);
else if (density < 0.2)
storage[i] = Blocks.Dirt;
storage.SetBlock(Blocks.Dirt, i);
else if (density < 0.3)
storage[i] = Blocks.Grass;
storage.SetBlock(Blocks.Grass, i);
}

target.SetStorage(storage);
Expand Down
2 changes: 1 addition & 1 deletion Common/World/Storage/SimpleStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Voxel.Common.World.Storage;
///
/// TODO - Pack this somehow? Do we need to?
/// </summary>
public class SimpleStorage : ChunkStorage {
public sealed class SimpleStorage : ChunkStorage {
private static readonly Stack<uint[]> BlockDataCache = new();

private readonly uint[] BlockIds;
Expand Down
2 changes: 1 addition & 1 deletion Common/World/Storage/SingleStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Voxel.Common.World.Storage;
///
/// When a new block is assigned to this storage, it automatically swaps itself out for a SimpleStorage with the appropriate data.
/// </summary>
public class SingleStorage : ChunkStorage {
public sealed class SingleStorage : ChunkStorage {
public readonly Chunk Chunk;
public readonly Block Block;

Expand Down

0 comments on commit 4b12d7a

Please sign in to comment.