public Mission(MissionType type, Factory factory) { this.type = type; this.factory = factory; this.acceptedMission = new SortedSet <Troop>(); this.prereqs = new Dictionary <Mission, HashSet <Troop> >(); this.planner = new MissionPlanner(this); switch (type) { case MissionType.Capture: solver = new CaptureMissionSolver(this); break; case MissionType.Defend: solver = new CaptureMissionSolver(this); break; case MissionType.IncSupport: solver = new IncSupportMissionSolver(this); break; case MissionType.Reinforce: solver = new ReinforceMissionSolver(this); break; case MissionType.FinalReinforce: solver = new FinalReinforceMissionSolver(this); break; case MissionType.Inc: solver = new IncreaseMissionSolver(this); break; case MissionType.Bomb: solver = new BombMissionSolver(this); break; default: break; } }