Skip to content

Commit

Permalink
Added OrbitGoal: minGForce and maxGForce mission script variables
Browse files Browse the repository at this point in the history
  • Loading branch information
vaughner81 committed Jun 11, 2013
1 parent 14e6fdb commit e4a287d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions plugin/OrbitGoal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public class OrbitGoal : MissionGoal
public double minVerticalSpeed = 0.0;
public double maxVerticalSpeed = 0.0;

public double minGForce = 0.0;
public double maxGForce = 0.0;

public String body = "Kerbin";

protected override List<Value> values(Vessel vessel) {
Expand Down Expand Up @@ -201,6 +204,24 @@ protected override List<Value> values(Vessel vessel) {
}
}

if (minGForce != 0.0) {
if (vessel == null) {
values.Add (new Value ("Min G Force", String.Format(MathTools.SingleDoubleValue, minGForce)));
} else {
values.Add (new Value ("Min G Force", String.Format(MathTools.SingleDoubleValue, minGForce),
vessel.geeForce, vessel.geeForce >= minGForce));
}
}

if (maxGForce != 0.0) {
if (vessel == null) {
values.Add (new Value ("Max G Force", String.Format(MathTools.SingleDoubleValue, maxGForce)));
} else {
values.Add (new Value ("Max G Force", String.Format(MathTools.SingleDoubleValue, maxGForce),
vessel.geeForce, vessel.geeForce <= maxGForce));
}
}

return values;
}

Expand Down

0 comments on commit e4a287d

Please sign in to comment.