public static Dictionary <string, HashSet <Room> > initializeRooms() { //if (DayCare.getInstance().rooms != null) //{ // return DayCare.getInstance().rooms; //} List <string> rules_data = RulesDAO.readFile(); Dictionary <string, HashSet <Room> > temp = new Dictionary <string, HashSet <Room> >(); for (int i = 1; i < rules_data.Count; i++) { string[] line = rules_data[i].Split(","); temp.Add(line[0], new HashSet <Room>()); } rooms = temp; return(rooms); }
public static Dictionary <string, GroupByAge> initializeGroups() { //if(DayCare.getInstance().groups != null) //{ // return DayCare.getInstance().groups; //} List <string> rules_data = RulesDAO.readFile(); Dictionary <string, GroupByAge> temp = new Dictionary <string, GroupByAge>(); for (int i = 1; i < rules_data.Count; i++) // Loop through List with for { string[] line = rules_data[i].Split(","); GroupByAge t = new GroupByAge(line[0]); t.groupSize = Convert.ToInt32(line[1]); t.maxGroupsInRoom = Convert.ToInt32(line[3]); temp.Add(line[0], t); } temp.Add("availableResources", new GroupByAge("availableResources")); groups = temp; return(groups); }