/// <summary> /// Gets the repair requirements from the Failure module for display to the user /// </summary> /// <returns>A List of all repair requirements for attempting repair of the part</returns> public List <RepairRequirements> GetRepairRequirements() { if (!Failed) { return(null); } if (repairConfig == null) { return(null); } List <RepairRequirements> requirements = new List <RepairRequirements>(); Vessel.Situations situation = this.vessel.situation; // In flight if (!repairConfig.canBeRepairedInFlight) { RepairRequirements requirement = new RepairRequirements(); requirement.requirementMessage = "Vessel must not be in flight"; if (situation == Vessel.Situations.DOCKED || situation == Vessel.Situations.LANDED || situation == Vessel.Situations.PRELAUNCH || situation == Vessel.Situations.SPLASHED) { requirement.requirementMet = true; } else { requirement.requirementMet = false; } requirements.Add(requirement); } // Splashed down if (!repairConfig.canBeRepairedOnSplashed) { RepairRequirements requirement = new RepairRequirements(); requirement.requirementMessage = "Vessel must not be in water"; if (situation == Vessel.Situations.SPLASHED) { requirement.requirementMet = false; } else { requirement.requirementMet = true; } requirements.Add(requirement); } // Requires EVA // TODO // Don't know how to do this yet // Remote repair if (!repairConfig.canBeRepairedByRemote) { RepairRequirements requirement = new RepairRequirements(); requirement.requirementMessage = "Vessel must not be under remote control"; if (this.vessel.GetCrewCount() <= 0) { requirement.requirementMet = false; } else { requirement.requirementMet = true; } requirements.Add(requirement); } // Replacement part if (repairConfig.replacementPart != "NONE") { RepairRequirements requirement = new RepairRequirements(); if (repairConfig.replacementPartOptional) { requirement.requirementMessage = "Having a replacement " + repairConfig.replacementPart + " on board would be a bonus"; requirement.optionalRequirement = true; requirement.repairBonus = repairConfig.replacementPartBonus; } else { requirement.requirementMessage = "Need a replacement " + repairConfig.replacementPart; } if (HasReplacementPart(repairConfig.replacementPart)) { requirement.requirementMet = true; } else { requirement.requirementMet = false; } requirements.Add(requirement); } return(requirements); }
/// <summary> /// Gets the repair requirements from the Failure module for display to the user /// </summary> /// <returns>A List of all repair requirements for attempting repair of the part</returns> public List<RepairRequirements> GetRepairRequirements() { if (!Failed) return null; if (repairConfig == null) return null; List<RepairRequirements> requirements = new List<RepairRequirements>(); Vessel.Situations situation = this.vessel.situation; // In flight if (!repairConfig.canBeRepairedInFlight) { RepairRequirements requirement = new RepairRequirements(); requirement.requirementMessage = "Vessel must not be in flight"; if (situation == Vessel.Situations.DOCKED || situation == Vessel.Situations.LANDED || situation == Vessel.Situations.PRELAUNCH || situation == Vessel.Situations.SPLASHED) { requirement.requirementMet = true; } else requirement.requirementMet = false; requirements.Add(requirement); } // Splashed down if (!repairConfig.canBeRepairedOnSplashed) { RepairRequirements requirement = new RepairRequirements(); requirement.requirementMessage = "Vessel must not be in water"; if (situation == Vessel.Situations.SPLASHED) { requirement.requirementMet = false; } else requirement.requirementMet = true; requirements.Add(requirement); } // Requires EVA // TODO // Don't know how to do this yet // Remote repair if (!repairConfig.canBeRepairedByRemote) { RepairRequirements requirement = new RepairRequirements(); requirement.requirementMessage = "Vessel must not be under remote control"; if (this.vessel.GetCrewCount() <= 0) requirement.requirementMet = false; else requirement.requirementMet = true; requirements.Add(requirement); } // Replacement part if (repairConfig.replacementPart != "NONE") { RepairRequirements requirement = new RepairRequirements(); if (repairConfig.replacementPartOptional) { requirement.requirementMessage = "Having a replacement " + repairConfig.replacementPart + " on board would be a bonus"; requirement.optionalRequirement = true; requirement.repairBonus = repairConfig.replacementPartBonus; } else { requirement.requirementMessage = "Need a replacement " + repairConfig.replacementPart; } if (HasReplacementPart(repairConfig.replacementPart)) requirement.requirementMet = true; else { requirement.requirementMet = false; } requirements.Add(requirement); } return requirements; }