예제 #1
0
        public void CheckSolution(Vector3 worldlocation)
        {
            // retrieve which country has been clicked by the user from trapezoidal decomp
            Trapezoid res = (Trapezoid)decomp.SearchGraph.Search(worldlocation).Value;

            searchResult = res.Bottom.Country;
            if (searchResult == levelCountry)
            {
                if (levelCountry == "Mordor")
                {
                    m_boromirExceptionContainer.gameObject.SetActive(true);
                    m_boromirExceptionText.gameObject.SetActive(true);
                }
                m_advanceButton.Enable();
            }
            else
            {
                m_tryagainContainer.gameObject.SetActive(true);
                m_tryagainText.gameObject.SetActive(true);
                m_advanceButton.Disable();
                if (searchResult == "null")
                {
                    m_tryagainText.text = "Try again! You clicked outside the map!";
                }
                else
                {
                    m_tryagainText.text = "Try again! You selected " + searchResult.ToString() + "!";
                }
            }
        }
 public void CheckSolution()
 {
     if (CheckHull())
     {
         m_advanceButton.Enable();
     }
     else
     {
         m_advanceButton.Disable();
     }
 }
 /// <summary>
 /// Checks whether there is a solution of sufficient quality present
 /// </summary>
 public void CheckSolution()
 {
     if (CheckTour())
     {
         m_advanceButton.Enable();
         m_giveUpButton.Disable();
     }
     else
     {
         m_giveUpButton.Enable();
         m_advanceButton.Disable();
     }
 }
예제 #4
0
 /// <summary>
 /// Update the text on hint button and enable/disable.
 /// </summary>
 private void UpdateHintButton()
 {
     if (m_numberOfHints > 0)
     {
         m_hintButton.SetText("Hint (" + m_numberOfHints + ")");
         m_hintButton.Enable();
     }
     else
     {
         m_hintButton.Disable();
     }
     m_advanceButton.Disable();
 }
예제 #5
0
        public void CheckSolution()
        {
            // calculate ratio of area visible
            var ratio = m_solution.Area / LevelPolygon.Area;

            Debug.Log(ratio + " part is visible");

            // see if entire polygon is covered
            if (MathUtil.GEQEps(ratio, 1f, 0.001f))
            {
                m_advanceButton.Enable();
            }
        }
예제 #6
0
        public void CheckSolution()
        {
            var stars = HullRate();

            if (stars == 0)
            {
                m_advanceButton.Disable();
            }
            else
            {
                m_advanceButton.Enable();
            }
        }
예제 #7
0
        public void CheckSolution()
        {
            if (m_levels[m_levelCounter].MaxNumberOfLighthouses != m_solution.Count || !CheckContainmentPoints())
            {
                return;
            }

            // calculate ratio of area visible
            var ratio = m_solution.Area / LevelPolygon.Area;

            Debug.Log(ratio + " part is visible");

            // see if entire polygon is covered
            // only check if no solution yet found
            if (MathUtil.GEQEps(ratio, 1f, 0.001f * m_levels[m_levelCounter].MaxNumberOfLighthouses))
            {
                m_advanceButton.Enable();
            }
        }