Пример #1
0
        public void TestPop()
        {
            var a = new GameStateDTO();

            Assert.IsFalse(buffer.HasNext());
            buffer.Enqueue(a);
            Assert.IsTrue(buffer.HasNext());
            Assert.AreEqual(buffer.Pop(), a);
        }
Пример #2
0
    // 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);
    }
Пример #3
0
    // 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);
    }