Bricklayer.Client.Game.CheckPosition C# (CSharp) Method

CheckPosition() public method

Checks to see if the mouse is over a control (Mostly used for seeing if you can place a block there)
public CheckPosition ( Point pos ) : bool
pos Point
return bool
        public bool CheckPosition(Point pos)
        {
            if (CurrentGameState == GameState.Game && (MainWindow.ScreenManager.Current as GameScreen).ChatBox.TextBox.Focused)
            {
                return false;
            }
            // Does the game window have focus?
            if (MainWindow.Focused)
            {
                foreach (Control c in Manager.Controls)
                {
                    if (CurrentGameState == GameState.Game && c == (MainWindow.ScreenManager.Current as GameScreen).ChatBox)
                    {
                        continue;
                    }

                    if (!CheckControlPos(c, pos))
                    {
                        return false;
                    }
                }
                // Mouse is not over any controls, but is within the application window.
                return true;
            }
            else
            {
                return false;
            }
        }