public Color GetLight() { BlockTypeDefault typeInst = BlockManager.BlockTypeList[(uint)BlockID]; Color? l = typeInst?.GetLight(this); return(l == null ? Color.Black : (Color)l); }
public static void AddBlockType(BlockTypeDefault blockType) { BlockTypeList[(ushort)blockType.GetBlockType()] = blockType; }
public bool IsSolid() { BlockTypeDefault typeInst = BlockManager.BlockTypeList[(uint)BlockID]; return((bool)typeInst?.IsSolid(this)); }
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); }
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); }
public void Draw(SpriteBatch spriteBatch, int x, int y) { BlockTypeDefault typeInst = BlockManager.BlockTypeList[(uint)BlockID]; typeInst?.Draw(spriteBatch, x, y, this); }