feat: add block model with IBlock flyweight and registry
This commit is contained in:
16
World/Blocks/GrassBlock.cs
Normal file
16
World/Blocks/GrassBlock.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace VoxelEngine.World.Blocks;
|
||||
|
||||
public sealed class GrassBlock : IBlock
|
||||
{
|
||||
public ushort Id => 3;
|
||||
public string Name => "Grass";
|
||||
public bool IsOpaque => true;
|
||||
public bool IsSolid => true;
|
||||
|
||||
public int GetTextureIndex(BlockFace face) => face switch
|
||||
{
|
||||
BlockFace.Top => 0, // grass top
|
||||
BlockFace.Bottom => 1, // dirt
|
||||
_ => 3 // grass side
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user