AIA.BuildingManager.KeyboardListener C# (CSharp) Method

KeyboardListener() public method

public KeyboardListener ( KeyboardState CurrentKeyboardState, KeyboardState LastKeyboardState, Microsoft.Xna.Framework.Input.MouseState CurrentMouseState, Microsoft.Xna.Framework.Input.MouseState LastMouseState ) : void
CurrentKeyboardState Microsoft.Xna.Framework.Input.KeyboardState
LastKeyboardState Microsoft.Xna.Framework.Input.KeyboardState
CurrentMouseState Microsoft.Xna.Framework.Input.MouseState
LastMouseState Microsoft.Xna.Framework.Input.MouseState
return void
        public void KeyboardListener(KeyboardState CurrentKeyboardState, KeyboardState LastKeyboardState, MouseState CurrentMouseState, MouseState LastMouseState)
        {
            //Creates an instance of a building at the position of the mouse when B is held down and left mouse button clicked
            if ((CurrentMouseState.LeftButton == ButtonState.Released && LastMouseState.LeftButton == ButtonState.Pressed) &&
                (CurrentKeyboardState.IsKeyDown(Keys.T)))
            {
                BaseBuilding newBuilding;
                newBuilding = new Tower();
                newBuilding.Build(new Vector2(CurrentMouseState.X, CurrentMouseState.Y));
                mBuildings.Add(newBuilding);
            }

            if ((CurrentMouseState.LeftButton == ButtonState.Released && LastMouseState.LeftButton == ButtonState.Pressed) &&
            (CurrentKeyboardState.IsKeyDown(Keys.W)))
            {
                BaseBuilding newBuilding;
                newBuilding = new Wall();
                newBuilding.Build(new Vector2(CurrentMouseState.X, CurrentMouseState.Y));
                mBuildings.Add(newBuilding);
            }

            if ((CurrentMouseState.LeftButton == ButtonState.Released && LastMouseState.LeftButton == ButtonState.Pressed) &&
            (CurrentKeyboardState.IsKeyDown(Keys.F)))
            {
                BaseBuilding newBuilding;
                newBuilding = new Factory();
                newBuilding.Build(new Vector2(CurrentMouseState.X, CurrentMouseState.Y));
                mBuildings.Add(newBuilding);
            }
        }