public bool IsCompatible(Mission mission) { if (this.outset >= mission.outset && this.outset <= mission.termination) return false; if (this.termination >= mission.outset && this.termination <= mission.termination) return false; if (this.outset <= mission.outset && this.termination >= mission.termination) return false; else return true; }
public void AddMission(Mission mission) { bool test = true; foreach (Mission item in this.missions) { if (!mission.IsCompatible(item)) test = false; } if (test) this.missions.Add(mission); }