XYInputTest
            (Vector2 angleInput, Vector3 expectedPosition)
        {
            float radius = expectedPosition.magnitude;

            Vector3 CalculatedPosition
                = OrreryUIManager
                  .CalculateNewCameraOffset(angleInput, radius);
            string ErrorMessage
                = DifferingResultsErrorMessage(
                      CalculatedPosition.ToString(),
                      expectedPosition.ToString(),
                      ""
                      );

            Assert.LessOrEqual(
                Math.Abs(CalculatedPosition.x - expectedPosition.x),
                AcceptableFloatError,
                ErrorMessage
                );
            Assert.LessOrEqual(
                Math.Abs(CalculatedPosition.y - expectedPosition.y),
                AcceptableFloatError,
                ErrorMessage
                );
            Assert.LessOrEqual(
                Math.Abs(CalculatedPosition.z - expectedPosition.z),
                AcceptableFloatError,
                ErrorMessage
                );
        }
        NoYInputTest
            (float xinput, float radius = 1000)
        {
            var     ExpectedPosition = new Vector3(0, radius, 0);
            Vector2 InputAngles      = new Vector2(xinput, 0);
            Vector3 CalculatedPosition
                = OrreryUIManager
                  .CalculateNewCameraOffset(InputAngles, radius);
            string ErrorMessage
                = DifferingResultsErrorMessage(
                      CalculatedPosition.ToString(),
                      ExpectedPosition.ToString(),
                      ""
                      );

            Assert.AreEqual(
                CalculatedPosition.x,
                ExpectedPosition.x,
                ErrorMessage
                );
            Assert.AreEqual(
                CalculatedPosition.y,
                ExpectedPosition.y,
                ErrorMessage
                );
            Assert.AreEqual(
                CalculatedPosition.z,
                ExpectedPosition.z,
                ErrorMessage
                );
        }
        NoXInputTest
            (float yinput, float radius = 1000)
        {
            Vector2 InputAngles      = new Vector2(0, yinput);
            float   YInputRadians    = OrreryUIManager.ConvertToRadians(yinput);
            float   ExpectedY        = Convert.ToSingle(radius * Math.Cos(YInputRadians));
            float   ExpectedZ        = Convert.ToSingle(radius * Math.Sin(YInputRadians));
            var     ExpectedPosition = new Vector3(0, ExpectedY, ExpectedZ);

            Vector3 CalculatedPosition
                = OrreryUIManager
                  .CalculateNewCameraOffset(InputAngles, radius);
            string ErrorMessage
                = DifferingResultsErrorMessage(
                      CalculatedPosition.ToString(),
                      ExpectedPosition.ToString(),
                      ""
                      );

            Assert.LessOrEqual(
                Math.Abs(CalculatedPosition.x - ExpectedPosition.x),
                AcceptableFloatError,
                ErrorMessage
                );
            Assert.LessOrEqual(
                Math.Abs(CalculatedPosition.y - ExpectedPosition.y),
                AcceptableFloatError,
                ErrorMessage
                );
            Assert.LessOrEqual(
                Math.Abs(CalculatedPosition.z - ExpectedPosition.z),
                AcceptableFloatError,
                ErrorMessage
                );
        }
Esempio n. 4
0
        private void InitialiseManagerFields()
        {
            MainMenuUIManager
                = ComponentRegistry
                  .RetrieveManager <MainMenuUIManager>
                      (UIElements.MainMenu);

            SettingsMenuManager
                = ComponentRegistry
                  .RetrieveManager <SettingsMenuUIManager>
                      (UIElements.SettingsMenu);

            InGameMenuManager
                = ComponentRegistry
                  .RetrieveManager <InGameMenuManager>
                      (UIElements.InGameMenu);

            GameplayUiManager
                = ComponentRegistry
                  .RetrieveManager <GameplayUIManager>
                      (UIElements.GameplayUI);

            OrreryUiManager
                = ComponentRegistry
                  .RetrieveManager <OrreryUIManager>
                      (UIElements.OrreryUI);
        }