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); } }
public void AddMember(TeamRoleBase member) { if (!members.Contains(member)) { members.Add(member); } }
public void SendMessage(TeamRoleBase sender, TeamMessage message) { members.ForEach(r => { if (r != sender) { r.ReceiveMessage(message); } }); }
public void RemoveMember(TeamRoleBase member) { members.Remove(member); }