feat: add block model with IBlock flyweight and registry

This commit is contained in:
2026-05-28 11:53:15 +02:00
parent 17503820e6
commit f4d3f9aab4
8 changed files with 156 additions and 0 deletions

21
World/IBlock.cs Normal file
View File

@@ -0,0 +1,21 @@
namespace VoxelEngine.World;
public interface IBlock
{
ushort Id { get; }
string Name { get; }
// Drives face culling: a face is emitted only if its neighbor is not opaque.
bool IsOpaque { get; }
// Reserved for future collision (not used in the baseline).
bool IsSolid { get; }
// Atlas tile index for the given face.
int GetTextureIndex(BlockFace face);
// Interaction hooks — capability present now, system built post-baseline.
void OnInteract() { }
void OnPlaced() { }
void OnBroken() { }
}