Exemple #1
0
        public Color GetLight()
        {
            BlockTypeDefault typeInst = BlockManager.BlockTypeList[(uint)BlockID];
            Color?           l        = typeInst?.GetLight(this);

            return(l == null ? Color.Black : (Color)l);
        }
Exemple #2
0
 public static void AddBlockType(BlockTypeDefault blockType)
 {
     BlockTypeList[(ushort)blockType.GetBlockType()] = blockType;
 }
Exemple #3
0
        public bool IsSolid()
        {
            BlockTypeDefault typeInst = BlockManager.BlockTypeList[(uint)BlockID];

            return((bool)typeInst?.IsSolid(this));
        }
Exemple #4
0
        public void Update(int x, int y, World world) //triggered when a surrounding block changes
        {
            BlockTypeDefault typeInst = BlockManager.BlockTypeList[(uint)BlockID];

            typeInst?.Update(x, y, this, world);
        }
Exemple #5
0
        public void RandomTick(int x, int y, World world) //will be triggered randomly. Used for plant grow and stuff.
        {
            BlockTypeDefault typeInst = BlockManager.BlockTypeList[(uint)BlockID];

            typeInst?.RandomTick(x, y, this, world);
        }
Exemple #6
0
        public void Draw(SpriteBatch spriteBatch, int x, int y)
        {
            BlockTypeDefault typeInst = BlockManager.BlockTypeList[(uint)BlockID];

            typeInst?.Draw(spriteBatch, x, y, this);
        }