public void TestPop() { var a = new GameStateDTO(); Assert.IsFalse(buffer.HasNext()); buffer.Enqueue(a); Assert.IsTrue(buffer.HasNext()); Assert.AreEqual(buffer.Pop(), a); }
// Manage the changes in the scene. void ProcessUpdate() { startTime = Time.time; if (!gameStateBuffer.HasNext()) { return; } GameStateDTO gameState = gameStateBuffer.Pop(); // TODO: era might have to be passed to each of the managers as a second // parameter, as some require it for the prefab name and each mapfeature // doesn't reach the scope of that JSON. // Player updates. PlayerDTO[] players = gameState.players; playerManager.UpdatePlayersState(players); // Pickup updates. PickupDTO[] pickups = gameState.pickups; pickupManager.UpdateFeatures(pickups); // Score updates. ScoreLocationDTO[] scores = gameState.scoreLocations; scorePointManager.UpdateFeatures(scores); }
// Manage the changes in the scene. void ProcessUpdate() { startTime = Time.time; if (!gameStateBuffer.HasNext()) { return; } GameStateDTO gameState = gameStateBuffer.Pop(); // TODO: era might have to be passed to each of the managers as a second // parameter, as some require it for the prefab name and each mapfeature // doesn't reach the scope of that JSON. // Player updates. PlayerDTO[] players = gameState.players; playerManager.UpdatePlayersState(players); // Interactable updates. InteractableDTO[] interactables = gameState.interactables; interactableManager.UpdateFeatures(interactables); }