public T GetHandler <T>(BlockIdentifier identifier) where T : IBlockHandler { if (_handlers.TryGetValue(identifier, out var handler)) { return((T)handler); } return(default);
private static bool BlockTypeIsSupported(BlockIdentifier blockID) { return blockID == BlockIdentifier.Dirt || blockID == BlockIdentifier.Cobblestone || blockID == BlockIdentifier.WoodPlank || blockID == BlockIdentifier.StoneBrick || blockID == BlockIdentifier.BrickBlock || blockID == BlockIdentifier.Wood || blockID == BlockIdentifier.Leaves || blockID == BlockIdentifier.Grass; }
private static bool BlockTypeIsSupported(BlockIdentifier blockID) { return (blockID == BlockIdentifier.Dirt || blockID == BlockIdentifier.Cobblestone || blockID == BlockIdentifier.WoodPlank || blockID == BlockIdentifier.StoneBrick || blockID == BlockIdentifier.BrickBlock || blockID == BlockIdentifier.Wood || blockID == BlockIdentifier.Leaves || blockID == BlockIdentifier.Grass); }
public static PhysicalMaterial FromBlockIdentifier(BlockIdentifier blockIdentifier) { switch (blockIdentifier) { case BlockIdentifier.Cobblestone: case BlockIdentifier.CobblestoneStairs: case BlockIdentifier.CobblestoneWall: case BlockIdentifier.Stone: case BlockIdentifier.StoneBrick: case BlockIdentifier.StoneBrickStairs: case BlockIdentifier.StonePlate: case BlockIdentifier.StoneSlab: return(PhysicalMaterial.Stone); default: return(PhysicalMaterial.Dirt); } }
public static PhysicalMaterial FromBlockIdentifier(BlockIdentifier blockIdentifier) { switch (blockIdentifier) { case BlockIdentifier.Cobblestone: case BlockIdentifier.CobblestoneStairs: case BlockIdentifier.CobblestoneWall: case BlockIdentifier.Stone: case BlockIdentifier.StoneBrick: case BlockIdentifier.StoneBrickStairs: case BlockIdentifier.StonePlate: case BlockIdentifier.StoneSlab: return PhysicalMaterial.Stone; default: return PhysicalMaterial.Dirt; } }
public Block FindBlock(BlockIdentifier identifier) { throw new NotImplementedException(); }
public Block(BlockIdentifier id, byte data) { this.id = id; this.data = data; }