Skip to content

[Ref] Current Block Types

Nicholas Fuller edited this page Dec 10, 2015 · 5 revisions

This will change in the future, for now, here's a reference to the types we have implemented.

// Copyright (c) Strange Loop Games. All rights reserved.
// See LICENSE file in the project root for full license information.

namespace Eco.Shared.Voxel
{
    using System;
    using System.Runtime.Serialization;
    using Eco.Shared.World;
    using Math;

    [Empty, Floodable]
    [DataContract]
    public class EmptyBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.Empty; } }
    }

    [Solid, Constructed]
    [DataContract]
    public class ConstructedWoodBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.ConstructedWood; } }
    }

    [Solid, Constructed]
    [DataContract]
    public class ConstructedLogBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.ConstructedLog; } }
    }

    [Solid, Constructed]
    [DataContract]
    public class ConstructedLogRoofBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.ConstructedLogRoof; } }
    }

    [Solid, Constructed]
    [DataContract]
    public class ConstructedStoneBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.ConstructedStone; } }
    }

    [Solid, Constructed]
    [DataContract]
    public class ConstructedStoneRoofBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.ConstructedStoneRoof; } }
    }

    [Solid, Constructed]
    [DataContract]
    public class ConstructedWoodRoofBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.WoodRoof; } }
    }

    [Solid, Constructed]
    [DataContract]
    public class WoodBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.Wood; } }
    }

    [Solid]
    [DataContract]
    public class TreeBranchBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.TreeBranch; } }
    }

    [Solid]
    [DataContract]
    public class LeavesBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.Leaves; } }
    }

    [Solid, RoomSeperator, Constructed]
    [DataContract]
    public class WoodWindowBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.WoodWindow; } }
    }

    [Solid, RoomSeperator, Constructed]
    [DataContract]
    public class MetalWindowBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.MetalWindow; } }
    }

    [DataContract]
    [Floodable]
    [Debris, Solid]
    public class DebrisBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return (LegacyBlockType)this.debrisType; } }

        [DataMember]
        public int debrisType;

        public DebrisBlock()
        { }

        public DebrisBlock(int debrisType)
        {
            this.debrisType = debrisType;
        }
    }

    [Solid, Constructed]
    [DataContract]
    public class IndustrialBuildingBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.IndustrialBuilding; } }
    }

    [Solid, Constructed]
    [DataContract]
    public class IndustrialBuildingRoofBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.AngledRoof_45; } }
    }

    [Solid, Diggable, PollutionSource]
    [DataContract]
    public class TailingsBlock : PermeableBlock
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.Tailings; } }

        public override byte WaterLoss { get { return 10; } }

        public override int PollutionLoss { get { return 0; } }

        [DataMember]
        private bool firstTick = true;

        public TailingsBlock()
        {
            this.pollutants = 10;
        }
    }

    [Solid, Diggable, PollutionSource]
    [DataContract]
    public class CharredEarthBlock : PermeableBlock
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.CharredEarth; } }

        public override byte WaterLoss { get { return byte.MaxValue; } }

        public override int PollutionLoss { get { return 1; } }

        public CharredEarthBlock()
        {
            this.pollutants = 256;
        }
    }

    [DataContract, Constructed]
    public class RailTrackBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.RailTrack; } }
    }

    [Solid, Constructed]
    [DataContract]
    public class BrickChimneyInsideBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.BrickChimneyInside; } }
    }

    [Solid, Constructed]
    [DataContract]
    public class BrickChimneyOutsideBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.BrickChimneyOutside; } }
    }

    [Solid, Constructed]
    [DataContract]
    public class AngledRoofBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.AngledRoof_45; } }
    }

    [Solid, Constructed]
    [DataContract]
    public class CementBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.Cement; } }
    }

    [Solid, Diggable, Tillable]
    [DataContract]
    public class MudBlock : PermeableBlock
    {
        public override byte WaterLoss { get { return 5; } }

        public override int PollutionLoss { get { return 4; } }

        public override LegacyBlockType LegacyType { get { return LegacyBlockType.Mud; } }
    }

    [Solid, Constructed]
    [DataContract]
    public class WoodFenceBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.WoodFence; } }
    }

    [Constructed]
    [DataContract]
    public class DirtRoadBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.DirtRoad; } }
    }

    [Constructed]
    [DataContract]
    public class StoneRoadBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.StoneRoad; } }
    }

    [Solid, Minable]
    [DataContract]
    public class IronOreBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.IronOre; } }
    }

    [Solid, Minable]
    [DataContract]
    public class CopperOreBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.CopperOre; } }
    }

    [Solid, Minable]
    [DataContract]
    public class GoldOreBlock : Block
    {
        public override LegacyBlockType LegacyType { get { return LegacyBlockType.GoldOre; } }
    }

}