Geometry Generation now in Block

This commit is contained in:
Simon Lübeß
2021-03-18 17:22:41 +01:00
parent 4e87f5f144
commit 8320689d3e
8 changed files with 280 additions and 126 deletions
+23 -3
View File
@@ -1,20 +1,40 @@
using GlitchyEngine.Math;
using GlitchyEngine;
namespace Sandbox.VoxelFun
{
class Block
{
private Model _model;
private uint16 _blockID;
public uint16 ID => _blockID;
public Color Color {get;}
public Model Model => _model;
public BlockFace VisibleNeighbors {get;}
public this(Color color, BlockFace visibleNeighbors = .None)
public this(BlockFace visibleNeighbors = .None)
{
Color = color;
VisibleNeighbors = visibleNeighbors;
}
/**
* This method will be called when the block is being destroyed by the player.
* @param blockCoordinate The coordinate the block is at.
*/
public virtual void OnBreaking(Int32_3 blockCoordinate)
{
Log.ClientLogger.Info($"I broke. {{{blockCoordinate}}}");
}
/**
* This method will be called when the block is being placed by the player.
* @param blockCoordinate The coordinate the block is at.
*/
public virtual void OnPlacing(Int32_3 blockCoordinate)
{
Log.ClientLogger.Info($"I broke. {{{blockCoordinate}}}");
}
}
}