Ejemplo n.º 1
0
        //------------------------------------------------------------------------------------------------------------------------
        //                                                  HandleNavigation()
        //------------------------------------------------------------------------------------------------------------------------
        private void HandleNavigation()
        {
            if (Input.GetKeyDown(Key.LEFT))
            {
                MoveSelection(-1, 0);
            }
            if (Input.GetKeyDown(Key.RIGHT))
            {
                MoveSelection(1, 0);
            }
            if (Input.GetKeyDown(Key.UP))
            {
                MoveSelection(0, -1);
            }
            if (Input.GetKeyDown(Key.DOWN))
            {
                MoveSelection(0, 1);
            }

            if (Input.GetKeyDown(Key.SPACE))
            {
                shop.Buy();
            }
            if (Input.GetKeyDown(Key.BACKSPACE))
            {
                shop.Sell();
            }

            if (Input.GetKeyDown(Key.C))
            {
                NotifyObservers();
            }
        }
 //------------------------------------------------------------------------------------------------------------------------
 //                                                  Sell()
 //------------------------------------------------------------------------------------------------------------------------
 public void Sell()
 {
     shopModel.Sell();
 }