public Mission() { this.dayList = new List<Day>(); this.team = new List<Astronaut>(); this.actTypeTree = null; this.locationList = new List<Location>(); }
public Activity(ActType myType, Day day, TimeSlot timeSlot, Location location, List<Astronaut> astrList, String Desc) { this.myType = myType; this.day = day; this.timeSlot = timeSlot; this.location = location; this.astrList = astrList; this.Desc = Desc; }
public static List<ActType> createActTypeList(XDocument doc) { List<ActType> actTypeList = new List<ActType>(); foreach (XElement actT in doc.Descendants("ActType")) { int id = Int32.Parse(actT.Attribute("ID").Value); string type = actT.Attribute("typeName").Value; ActType act = new ActType(type, id); actTypeList.Add(act); } for (int x = 1; x < 7; x++) { actTypeList[0].addChild(actTypeList[x]); } actTypeList[8].addChild(actTypeList[9]); actTypeList[8].addChild(actTypeList[10]); actTypeList[7].addChild(actTypeList[8]); for (int x = 11; x < 15; x++) { actTypeList[7].addChild(actTypeList[x]); } for (int x = 16; x < 23; x++) { actTypeList[15].addChild(actTypeList[x]); } actTypeList[23].addChild(actTypeList[24]); actTypeList[23].addChild(actTypeList[25]); for (int x = 27; x < 34; x++) { actTypeList[26].addChild(actTypeList[x]); } return actTypeList; }
public void addChild(ActType child) { childs.Add(child); }
public static Mission loadFile(string generalFile, string activityFile) { //exemple generalFile = "generalInfo.xml"; activityFile = "defaultPlan.xml"; XDocument generalInfo = XDocument.Load(generalFile); List<ActType> actTypeList = createActTypeList(generalInfo); XDocument activityPlan = XDocument.Load(activityFile); Mission mission = new Mission(); ActType actTypeTree = new ActType("Activity tree", 0); actTypeTree.addChild(actTypeList[0]); //Living actTypeTree.addChild(actTypeList[7]); //Science actTypeTree.addChild(actTypeList[15]);//Maintenance actTypeTree.addChild(actTypeList[23]);//Communication actTypeTree.addChild(actTypeList[26]);//Repair actTypeTree.addChild(actTypeList[34]);//Emergency mission.setActTypeTree(actTypeTree); importPlan(activityPlan, actTypeList, mission); return mission; }
public void setActTypeTree(ActType actTypeTree) { this.actTypeTree = actTypeTree; }
public void setMyType(ActType myType) { if (this.day.getnDay() > DateTimeExtension.marsToday) { this.myType = myType; } }