public void UseBlock(bool marioFacingLeft)
        {
            IBlockState state = new UsedBlockState();

            state.StoreItem(storedItem);
            state.SetBlock(block);
            block.State = state;
            block.setSpriteFromState();
            block.State.UseBlock(marioFacingLeft);
            block.State.BumpBlock();
        }
Esempio n. 2
0
 public void ProduceItem(bool MarioFacingLeft)
 {
     marioFacingLeft = MarioFacingLeft;
     if (storedItems.Count != 0)
     {
         IItem item = storedItems.Dequeue();
         item.GetProduced(marioFacingLeft);
         if (storedItems.Count == 0)
         {
             IBlockState state = new UsedBlockState();
             state.StoreItem(item);
             state.SetBlock(block);
             block.State = state;
             block.setSpriteFromState();
             block.State.UseBlock(marioFacingLeft);
             block.State.BumpBlock();
         }
     }
 }