public void TestTaxToSupportReturnsNotFoundWithIdMismatch() { //Get a test controller GameContext context = GetTestContext("gameloop_tax_to_support_mismatch"); GameLoopController testController = new GameLoopController(context); //Generate the form data TaxToSupportInput input = new TaxToSupportInput { Id = 4, Cities = 5 }; //Run the controller's ResolveTaxToSupport() with a mismatched Id IActionResult result = testController.ResolveTaxToSupport(1, input); //Assert that we got a not found result Assert.IsType <NotFoundResult>(result); }
// Movement and physics should happen here void FixedUpdate() { // Ignore input and stuff while not in the digging scene if (!GameLoopController.isDiggingScene() || DiggingUIOverlay.IsPopupVisible()) { mRigidbody.velocity = Vector3.zero; mRigidbody.gravityScale = 0f; return; } if (!mInputDisabled) { HandleMovement(); mRigidbody.gravityScale = (mWallClimbingLeft || mWallClimbingRight || mGrappleState != GRAPPLE_NONE) ? 0f : 1f; } }
private void Start() { new Statistics(); Statistics.instance.gameOver.AddListener((int i) => StopCoroutine(gameLoop)); //Event for gameOver and stopping coroutine //For only temporarily offline testing. Distributing roles goes on before this scene distributeRoles(); if (Current == null) { Current = this; } else { Destroy(gameObject); } gameLoop = GameLoop(); StartCoroutine(gameLoop); }
public void TestTaxToSupportReturnsToFormOnInvalidModel() { //Get a test controller GameContext context = GetTestContext("gameloop_tax_to_support_invalid"); GameLoopController testController = new GameLoopController(context); //Add an error to force the Post: Create() method to return to the form testController.ModelState.AddModelError("test error", "automated unit test error"); //Generate the form data TaxToSupportInput input = new TaxToSupportInput { Id = 1, Cities = 5 }; //Run the controller's ResolveTaxToSupport() with an invalid model IActionResult result = testController.ResolveTaxToSupport(1, input); //Assert that... //...we got a view back ViewResult viewResult = Assert.IsType <ViewResult>(result); }
// Input and animation can happen here private void Update() { mIsTryingToDig = false; mIsDigging = false; mUsingStamina = false; var emission = digEffect.emission; // Ignore input and stuff while not in the digging scene, or if there's a popup if (!GameLoopController.isDiggingScene() || DiggingUIOverlay.IsPopupVisible() || mInputDisabled) { AnimatePausedPlayer(); emission.enabled = false; return; } HandleMouseInput(); UpdateAnimationState(); // reveal nearby tiles RevealFogTiles(); emission.enabled = mIsDigging; }
public void CanResolveTaxToSupport() { //Get a test controller GameContext context = GetTestContext("gameloop_tax_to_support"); GameLoopController testController = new GameLoopController(context); //Generate the form data TaxToSupportInput input = new TaxToSupportInput { Id = 1, Cities = 5 }; //Run the controller's Details() without an Id IActionResult result = testController.ResolveTaxToSupport(1, input); //Assert that... //...we got a redirect back RedirectToActionResult redirect = Assert.IsType <RedirectToActionResult>(result); //...the action is the index Assert.Equal(nameof(GameLoopController.Index), redirect.ActionName); //...the route data is the ID of the active civ Assert.Equal(input.Id, redirect.RouteValues["id"]); }
void Awake() { playerDatingController = GetComponent <PlayerDatingController>(); gameLoopController = FindObjectOfType <GameLoopController>(); FillDialogueTrees(); }
private void Awake() { instance = this; }
public void StopDigging() { GameLoopController.StopDigging(); }
private void InitializeCameraController() { _gameLoopController = new GameLoopController(this); _cameraController = new CameraController(Camera, _gameLoopController); }
public void Init() { m_scannerManager = InstanceManager.ScannerManager; m_guiManager = InstanceManager.GUIManager; m_gameLoopController = InstanceManager.GameLoopController; }