Exemplo n.º 1
0
        private void ClearFDep(int sourceID, List <dynamic> args, string rawCommand)
        {
            fdepartments.Clear();
            FDepartment department = new FDepartment
            {
                Name = "test"
            };

            fdepartments.Add(department);
            DatabaseSave();
        }
Exemplo n.º 2
0
        private FDepartment GetFDepartmentFromID(int id)
        {
            FDepartment department = null;

            foreach (FDepartment dep in fdepartments)
            {
                if (fdepartments.IndexOf(dep) == id)
                {
                    department = dep;
                }
            }
            return(department);
        }
Exemplo n.º 3
0
 private void AddFDepartment(int sourceID, List <dynamic> args, string rawCommand)
 {
     if (args.Count >= 2)
     {
         string[]    splitArgs = args.Select(x => (string)x).ToArray();
         FDepartment dep       = new FDepartment
         {
             Name         = string.Join(" ", splitArgs).Replace(splitArgs[0] + " ", ""),
             Acronym      = splitArgs[0].ToString().ToUpper(),
             firefighters = new List <Firefighter>()
         };
         fdepartments.Add(dep);
         DatabaseSave();
         Debug.WriteLine("\"" + dep.Name + "\" (" + dep.Acronym + ") was added as a Fire Department!");
     }
     else
     {
         Debug.WriteLine("Invalid Syntax, use: pmaddfd <Acronym> <Department Name>");
     }
 }
Exemplo n.º 4
0
        private void ClearDB()
        {
            cops.Clear();
            admins.Clear();
            departments.Clear();
            fdepartments.Clear();
            firefighters.Clear();
            Cop cop = new Cop
            {
                Hex = "test"
            };
            Admin admin = new Admin
            {
                Hex = "test"
            };
            Firefighter ff = new Firefighter
            {
                Hex = "test"
            };
            Department department = new Department
            {
                Name = "test"
            };
            FDepartment fdepartment = new FDepartment
            {
                Name = "test"
            };

            cops.Add(cop);
            admins.Add(admin);
            firefighters.Add(ff);
            departments.Add(department);
            fdepartments.Add(fdepartment);
            Tuple <List <Cop>, List <Admin>, List <Firefighter>, List <Department>, List <FDepartment> > write = new Tuple <List <Cop>, List <Admin>, List <Firefighter>, List <Department>, List <FDepartment> >(cops, admins, firefighters, departments, fdepartments);

            database.Write(write);
        }
Exemplo n.º 5
0
 private void RemoveFDepartment(int sourceID, List <dynamic> args, string rawCommand)
 {
     if (args.Count == 1)
     {
         FDepartment dep = null;
         if (fdepartments.Count > Convert.ToInt32(args[0]))
         {
             dep = fdepartments[Convert.ToInt32(args[0])];
         }
         if (dep == null)
         {
             Debug.WriteLine("Invalid Department ID!");
             return;
         }
         fdepartments.Remove(dep);
         DatabaseSave();
         Debug.WriteLine("Department Deleted!");
     }
     else
     {
         Debug.WriteLine("Invalid Syntax, use: pmremovefd <Department ID>");
         return;
     }
 }