public void ChangeState(BlockStateBase newState) { BlockState = newState; BlockState.SetParentBlock(this); if (Sprite == null) Sprite = new BlockSprite(this, BlockState.GetFrames()); }
public Block(BlockStateBase state, Vector2 position) : base(SprintFourGame.GetInstance()) { BlockState = state; BlockState.SetParentBlock(this); if (!(state is HiddenBlockState)) { Sprite = new BlockSprite(this, state.GetFrames()); } Position = position; DrawOrder = Utility.BLOCK_DRAW_ORDER; }