public UserDisplay(XnaBasics game, SpriteBatch spriteBatch) : base(game)
 {
     this.spriteBatch = spriteBatch;
     SummonKey        = spawnKey;
     MoveLeft         = moveLeft;
     MoveRight        = moveRight;
     MoveUp           = moveUp;
     MoveDown         = moveDown;
     TwistKey         = twistKey;
     TurnKey          = turnKey;
     OpenDoor         = openDoor;
 }
 private void turnKey()
 {
     key.TurnKey();
     if ((Math.Abs((key.yrotation % MathHelper.TwoPi) - MathHelper.PiOver2) < 0.1f) && cloister.unlockDoor(key.position.X, key.position.Y))
     {
         errorMessage = "Door unlocked!";
     }
     else
     {
         errorMessage = "Door was is still locked";
     }
     errorTime     = 5;
     lastDelCalled = TurnKey;
 }
 private void openDoor()
 {
     if (cloister.openDoor())
     {
         key.Hide();
         key.TwistKey(-MathHelper.PiOver2);
         lastDelCalled = OpenDoor;
     }
     else
     {
         errorMessage = "Door is locked- cannot open!";
     }
     errorTime = 5;
 }
 public String getDelegateDescription(StateManipDel smd)
 {
     if (smd == SummonKey)
     {
         return("This summons the key in front of you, or resets it to its original position.");
     }
     else if (smd == MoveLeft)
     {
         return("This moves the key to the left.");
     }
     else if (smd == MoveRight)
     {
         return("This moves the key to the right.");
     }
     else if (smd == MoveUp)
     {
         return("This moves the key up.");
     }
     else if (smd == MoveDown)
     {
         return("This moves the key down.");
     }
     else if (smd == TurnKey)
     {
         return("This turns the key. If in a lock, this will open it.");
     }
     else if (smd == TwistKey)
     {
         return("This spins the key around, so you can face it towards a lock.");
     }
     else if (smd == OpenDoor)
     {
         return("This opens the door, once it has been unlocked.");
     }
     else
     {
         return("");
     }
 }
 private void twistKey()
 {
     key.TwistKey(MathHelper.PiOver2);
     lastDelCalled = TwistKey;
 }
 private void moveDown()
 {
     key.Move(Vector3.Down * 20);
     lastDelCalled = MoveDown;
 }
 private void moveUp()
 {
     key.Move(Vector3.Up * 20);
     lastDelCalled = MoveUp;
 }
 private void moveRight()
 {
     key.Move(Vector3.Right * 20);
     lastDelCalled = MoveRight;
 }
 private void moveLeft()
 {
     key.Move(Vector3.Left * 20);
     lastDelCalled = MoveLeft;
 }