Example #1
0
        public override string RemoveSeal()
        {
            string output = bottleState.RemoveSeal();

            if (bottleState is SealedBottle)
            {
                bottleState = new UnsealedBottle();
            }

            return(output);
        }
Example #2
0
        public override string OpenBottle()
        {
            string output = bottleState.OpenBottle();

            if (bottleState is UnsealedBottle || bottleState is ClosedBottle)
            {
                bottleState = new OpenedBottle();
            }

            return(output);
        }
Example #3
0
        public override string CloseBottle()
        {
            string output = bottleState.CloseBottle();

            if (bottleState is OpenedBottle)
            {
                bottleState = new ClosedBottle();
            }

            return(output);
        }
Example #4
0
 public void SetState(BottleState state)
 {
     currState = state;
 }