namespace Voxel { public enum Blocks : byte { Air, Stone, Dirt, OakPlanks, Grass, Bedrock, Sand } public enum Orientation : byte { West = 0, // + X East = 1, // - X Top = 2, // + Y Bottom = 3,// - Y North = 4, // + Z South = 5, // - Z } public class BlockDefinition { public Blocks BlockType; public Textures[] FaceTextures; public BlockDefinition(Blocks type, Textures singleTexture) { BlockType = type; FaceTextures = new Voxel.Textures[6]; for (int i = 0; i < 6; i++) FaceTextures[i] = singleTexture; } public BlockDefinition( Blocks type, Textures west, Textures east, Textures top, Textures bottom, Textures north, Textures south ) { BlockType = type; FaceTextures = new Textures[] { west, east, top, bottom, north, south }; } } public static class BlockDefinitions { public static readonly Dictionary Blocks; static BlockDefinitions() { Blocks = new Dictionary { {Voxel.Blocks.Stone, new BlockDefinition( Voxel.Blocks.Stone, Textures.Stone )}, {Voxel.Blocks.Dirt, new BlockDefinition( Voxel.Blocks.Dirt, Textures.Dirt )}, {Voxel.Blocks.OakPlanks, new BlockDefinition( Voxel.Blocks.OakPlanks, Textures.OakPlanks )}, {Voxel.Blocks.Bedrock, new BlockDefinition( Voxel.Blocks.Bedrock, Textures.Bedrock )}, {Voxel.Blocks.Sand, new BlockDefinition( Voxel.Blocks.Sand, Textures.Sand )}, { Voxel.Blocks.Grass, new BlockDefinition( Voxel.Blocks.Grass, Voxel.Textures.GrassSide, // West Voxel.Textures.GrassSide, // East Voxel.Textures.GrassTop, // Top Voxel.Textures.Dirt, // Bottom Voxel.Textures.GrassSide, // North Voxel.Textures.GrassSide // South )}, }; } } }