예제 #1
0
        //removes the user from either of the groups
        public string RemoveUser(string user)
        {
            CwsUser u  = new CwsUser(user);
            CwsUser u2 = new CwsUser(user + "*");

            if (saradominTeam.Contains(u))
            {
                saradominTeam.Remove(u);
                return(user + " was removed from the Saradomin team.");
            }
            else if (zamorakTeam.Contains(u))
            {
                zamorakTeam.Remove(u);
                return(user + " was removed from the Zamorak team.");
            }
            else if (saradominTeam.Contains(u2))
            {
                saradominTeam.Remove(u2);
                return(user + " was removed from the Saradomin team.");
            }
            else if (zamorakTeam.Contains(u2))
            {
                zamorakTeam.Remove(u2);
                return(user + " was removed from the Zamorak team.");
            }
            else
            {
                return(user + " was not on any teams!");
            }
        }
예제 #2
0
        //adds the user to the team with the least amt of people, or to sara if equal
        public string AddRotating(string user)
        {
            CwsUser u  = new CwsUser(user);
            CwsUser u2 = new CwsUser(user + "*");

            if (!saradominTeam.Contains(u) && !zamorakTeam.Contains(u) && !saradominTeam.Contains(u2) &&
                !zamorakTeam.Contains(u2))
            {
                if (saradominTeam.Count == zamorakTeam.Count)
                {
                    saradominTeam.Add(u);
                    return(u.Username + " has been added to the Saradomin team.");
                }
                else
                {
                    if (saradominTeam.Count < zamorakTeam.Count)
                    {
                        saradominTeam.Add(u);
                        return(u.Username + " has been added to the Saradomin team.");
                    }
                    else
                    {
                        zamorakTeam.Add(u);
                        return(u.Username + " has been added to the Zamorak team.");
                    }
                }
            }
            else
            {
                return("That user is already on a team!");
            }
        }
예제 #3
0
        //adds the user as a perm to a team
        public string AddPerm(string user, string side)
        {
            CwsUser u  = new CwsUser(user);
            CwsUser u2 = new CwsUser(user + "*");

            if (!saradominTeam.Contains(u) && !zamorakTeam.Contains(u) && !saradominTeam.Contains(u2) &&
                !zamorakTeam.Contains(u2))
            {
                if (side == "s")
                {
                    saradominTeam.Add(u2);
                    return(u.Username + " has been added as a perm to the Saradomin team.");
                }
                else if (side == "z")
                {
                    zamorakTeam.Add(u2);
                    return(u.Username + " has been added as a perm to the Zamorak team.");
                }
                else
                {
                    return("Invalid side");
                }
            }
            else
            {
                return("That user is already on a team!");
            }
        }
예제 #4
0
 private bool CheckIfPerm(CwsUser u)
 {
     if (u.Username.Contains("*"))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }