Beispiel #1
0
    internal void InitializeStarshipsTeams(List <List <Starship> > starships)
    {
        StarshipsTeam starshipsTeam;

        for (int i = 0; i < starships.Count; ++i)
        {
            starshipsTeam = new StarshipsTeam(starships[i]);
            starshipsTeam.OnTeamDevastated += OnTeamDevastated;
            StarshipsTeams.Add(starshipsTeam);
        }
    }
Beispiel #2
0
    private void OnTeamDevastated(StarshipsTeam starshipsTeam)
    {
        int i = 0;

        for (int j = 0; j < StarshipsTeams.Count; ++j)
        {
            if (!StarshipsTeams[j].isDevastated)
            {
                i += 1;
            }
        }
        if (i == 1)
        {
            OnOneTeamLeft?.Invoke();
            SetStarshipsFollowEnemy(false);
        }
    }