Exemple #1
0
 // Invoke the event.
 void onChangedPhase(RoundAndPhaseEventArgs e)
 {
     if (ChangedPhase != null)
     {
         ChangedPhase(this, e);
     }
 }
Exemple #2
0
    void UpdateBoard(object sender, RoundAndPhaseEventArgs e)
    {
        int round = e.Round;

        Game.Phase phase = e.Phase;
        Debug.Log(round + " " + phase);

        // Look up the board for each ship.
        foreach (SpaceShip ship in board.Ships.Keys)
        {
            // Check if the ship exists in the dictionary.
            if (shipsToGameObject.ContainsKey(ship))
            {
                // Move the ship to its new position.
                MoveSpaceShip(shipsToGameObject [ship], board.Ships [ship], MoveDuration);
            }
            else
            {
                // Create the ship.
                shipsToGameObject.Add(ship, CreateSpaceShip(board.Ships [ship]));
            }
        }
    }