/// <summary> /// Finishes the given mission goal with the given vessel. /// Rewards the space program with the reward from mission goal. /// </summary> /// <param name="goal">Goal.</param> /// <param name="vessel">Vessel.</param> public void finishMissionGoal(MissionGoal goal, Vessel vessel, GameEvent events) { if (!isMissionGoalAlreadyFinished(goal, vessel) && goal.nonPermanent && goal.isDone(vessel, events)) { currentProgram.add(new GoalStatus(vessel.id.ToString(), goal.id)); reward(goal.reward); } }
public static void WriteBase(StringBuilder builder, int nestingLevel, MissionGoal goal) { Write(builder, nestingLevel, "description", goal.description); Write(builder, nestingLevel, "reward", goal.reward); Write(builder, nestingLevel, "optional", goal.optional); Write(builder, nestingLevel, "throttleDown", goal.throttleDown, true); Write(builder, nestingLevel, "repeatable", goal.repeatable); Write(builder, nestingLevel, "minSeconds", goal.minSeconds, defaultValue: -1); Write(builder, nestingLevel, "minTotalMass", goal.minTotalMass); Write(builder, nestingLevel, "maxTotalMass", goal.maxTotalMass); }
/// <summary> /// Returns true, if the given mission goal has been finish in another game with the given vessel, false otherwise /// </summary> /// <returns><c>true</c>, if mission goal already finished, <c>false</c> otherwise.</returns> /// <param name="c">goal</param> /// <param name="v">vessel</param> public bool isMissionGoalAlreadyFinished(MissionGoal c, Vessel v) { if (v == null) { return(false); } foreach (GoalStatus con in currentProgram.completedGoals) { // If the mission goal is an EVAGoal, we don't care about the vessel id. Otherwise we do... if (con.id.Equals(c.id) && (con.vesselGuid.Equals(v.id.ToString()) || c.vesselIndenpendent)) { return(true); } } return(false); }
public void add(MissionGoal c) { subGoals.Add (c); }
public void add(MissionGoal c) { subGoals.Add(c); }
/// <summary> /// Returns true, if the given mission goal has been finish in another game with the given vessel, false otherwise /// </summary> /// <returns><c>true</c>, if mission goal already finished, <c>false</c> otherwise.</returns> /// <param name="c">goal</param> /// <param name="v">vessel</param> public bool isMissionGoalAlreadyFinished(MissionGoal c, Vessel v) { if (v == null) { return false; } foreach (GoalStatus con in currentProgram.completedGoals) { // If the mission goal is an EVAGoal, we don't care about the vessel id. Otherwise we do... if(con.id.Equals(c.id) && (con.vesselGuid.Equals (v.id.ToString()) || c.vesselIndenpendent)) { return true; } } return false; }
/// <summary> /// Finishes the given mission goal with the given vessel. /// Rewards the space program with the reward from mission goal. /// </summary> /// <param name="goal">Goal.</param> /// <param name="vessel">Vessel.</param> public void finishMissionGoal(MissionGoal goal, Vessel vessel, GameEvent events) { if (!isMissionGoalAlreadyFinished (goal, vessel) && goal.nonPermanent && goal.isDone(vessel, events)) { currentProgram.add(new GoalStatus(vessel.id.ToString(), goal.id)); reward (goal.reward); } }