예제 #1
0
파일: Block.cs 프로젝트: DrFlave/Quadradria
        public Color GetLight()
        {
            BlockTypeDefault typeInst = BlockManager.BlockTypeList[(uint)BlockID];
            Color?           l        = typeInst?.GetLight(this);

            return(l == null ? Color.Black : (Color)l);
        }
예제 #2
0
 public static void AddBlockType(BlockTypeDefault blockType)
 {
     BlockTypeList[(ushort)blockType.GetBlockType()] = blockType;
 }
예제 #3
0
파일: Block.cs 프로젝트: DrFlave/Quadradria
        public bool IsSolid()
        {
            BlockTypeDefault typeInst = BlockManager.BlockTypeList[(uint)BlockID];

            return((bool)typeInst?.IsSolid(this));
        }
예제 #4
0
파일: Block.cs 프로젝트: DrFlave/Quadradria
        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);
        }
예제 #5
0
파일: Block.cs 프로젝트: DrFlave/Quadradria
        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);
        }
예제 #6
0
파일: Block.cs 프로젝트: DrFlave/Quadradria
        public void Draw(SpriteBatch spriteBatch, int x, int y)
        {
            BlockTypeDefault typeInst = BlockManager.BlockTypeList[(uint)BlockID];

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