Пример #1
0
        new void Awake()
        {
            base.Awake();
            SetName("Team Blueberry");

            sneakerTeam1.Reset();
            sneakerTeam2.Reset();
            sniperTeam1.Reset();
            sniperTeam2.Reset();

            Team teamToAdd = sniperTeam1;

            if (sniperTeam1.MemberCount == 3)
            {
                teamToAdd = sniperTeam2;
            }
            if (sniperTeam2.MemberCount == 3)
            {
                teamToAdd = sneakerTeam1;
            }
            if (sneakerTeam1.MemberCount > sneakerTeam2.MemberCount)
            {
                teamToAdd = sneakerTeam2;
            }

            if ((teamToAdd == sneakerTeam1) || (teamToAdd == sneakerTeam2))
            {
                MyRole = new TeamRoleSneaker(this, teamToAdd);
            }
            else
            {
                MyRole = new TeamRoleSniper(this, teamToAdd);
            }
        }
Пример #2
0
 public void AddMember(TeamRoleBase member)
 {
     if (!members.Contains(member))
     {
         members.Add(member);
     }
 }
Пример #3
0
 public void SendMessage(TeamRoleBase sender, TeamMessage message)
 {
     members.ForEach(r => {
         if (r != sender)
         {
             r.ReceiveMessage(message);
         }
     });
 }
Пример #4
0
 public void RemoveMember(TeamRoleBase member)
 {
     members.Remove(member);
 }