protected override void OnLoad(ConfigNode node)
 {
     base.OnLoad(node);
     title       = node.GetValue("title");
     destination = ConfigNodeUtil.ParseValue <CelestialBody>(node, "destination");
     entryType   = (FlightLog.EntryType)Enum.Parse(typeof(FlightLog.EntryType), node.GetValue("entryType"));
 }
 protected override void OnParameterLoad(ConfigNode node)
 {
     base.OnParameterLoad(node);
     destination = ConfigNodeUtil.ParseValue<CelestialBody>(node, "destination");
     entryType = (FlightLog.EntryType)Enum.Parse(typeof(FlightLog.EntryType), node.GetValue("entryType"));
 }
 public VesselHasVisited(CelestialBody destination, FlightLog.EntryType entryType, string title)
     : base(title)
 {
     if (title == null)
     {
         this.title = "Perform ";
         switch (entryType)
         {
             case FlightLog.EntryType.BoardVessel:
                 this.title = "Board a vessel on ";
                 break;
             case FlightLog.EntryType.Die:
                 this.title = "Die on ";
                 break;
             case FlightLog.EntryType.Escape:
                 this.title += "an escape from";
                 break;
             case FlightLog.EntryType.ExitVessel:
                 this.title = "Exit a vessel on ";
                 break;
             case FlightLog.EntryType.Flight:
                 this.title += "a flight on ";
                 break;
             case FlightLog.EntryType.Flyby:
                 this.title += "a flyby of ";
                 break;
             case FlightLog.EntryType.Land:
                 this.title += "a landing on ";
                 break;
             case FlightLog.EntryType.Launch:
                 this.title += "a launch from ";
                 break;
             case FlightLog.EntryType.Orbit:
                 this.title += "an orbit of ";
                 break;
             case FlightLog.EntryType.PlantFlag:
                 this.title = "Plant a flag on ";
                 break;
             case FlightLog.EntryType.Recover:
                 this.title += " a recovery on ";
                 break;
             case FlightLog.EntryType.Spawn:
                 this.title = "Spawn on ";
                 break;
             case FlightLog.EntryType.Suborbit:
                 this.title += "a sub-orbital trajectory of ";
                 break;
         }
         if (destination != null)
         {
             this.title += destination.theName;
         }
         else
         {
             this.title += "any body";
         }
     }
     else
     {
         this.title = title;
     }
     this.destination = destination;
     this.entryType = entryType;
 }
Ejemplo n.º 4
0
        public VesselHasVisited(CelestialBody destination, FlightLog.EntryType entryType, string title)
            : base(title)
        {
            if (title == null)
            {
                string bodyStr = (destination != null) ? destination.displayName : Localizer.GetStringByTag("#cc.anyBody").ToLower();
                switch (entryType)
                {
                case FlightLog.EntryType.BoardVessel:
                    this.title = Localizer.Format("#cc.param.VesselHasVisited.BoardVessel", bodyStr);
                    break;

                case FlightLog.EntryType.Die:
                    this.title = Localizer.Format("#cc.param.VesselHasVisited.Die", bodyStr);
                    break;

                case FlightLog.EntryType.Escape:
                    this.title = Localizer.Format("#cc.param.VesselHasVisited.Escape", bodyStr);
                    break;

                case FlightLog.EntryType.ExitVessel:
                    this.title = Localizer.Format("#cc.param.VesselHasVisited.ExitVessel", bodyStr);
                    break;

                case FlightLog.EntryType.Flight:
                    this.title = Localizer.Format("#cc.param.VesselHasVisited.Flight", bodyStr);
                    break;

                case FlightLog.EntryType.Flyby:
                    this.title = Localizer.Format("#cc.param.VesselHasVisited.Flyby", bodyStr);
                    break;

                case FlightLog.EntryType.Land:
                    this.title = Localizer.Format("#cc.param.VesselHasVisited.Land", bodyStr);
                    break;

                case FlightLog.EntryType.Launch:
                    this.title = Localizer.Format("#cc.param.VesselHasVisited.Launch", bodyStr);
                    break;

                case FlightLog.EntryType.Orbit:
                    this.title = Localizer.Format("#cc.param.VesselHasVisited.Orbit", bodyStr);
                    break;

                case FlightLog.EntryType.PlantFlag:
                    this.title = Localizer.Format("#cc.param.VesselHasVisited.PlantFlag", bodyStr);
                    break;

                case FlightLog.EntryType.Recover:
                    this.title = Localizer.Format("#cc.param.VesselHasVisited.Recover", bodyStr);
                    break;

                case FlightLog.EntryType.Spawn:
                    this.title = Localizer.Format("#cc.param.VesselHasVisited.Spawn", bodyStr);
                    break;

                case FlightLog.EntryType.Suborbit:
                    this.title = Localizer.Format("#cc.param.VesselHasVisited.Suborbit", bodyStr);
                    break;
                }
                if (destination != null)
                {
                    this.title += destination.displayName;
                }
                else
                {
                    this.title += "any body";
                }
            }
            else
            {
                this.title = title;
            }
            this.destination = destination;
            this.entryType   = entryType;
        }
        public VesselHasVisited(CelestialBody destination, FlightLog.EntryType entryType, string title)
            : base()
        {
            if (title == null)
            {
                this.title = "Perform ";
                switch (entryType)
                {
                case FlightLog.EntryType.BoardVessel:
                    this.title = "Board a vessel on ";
                    break;

                case FlightLog.EntryType.Die:
                    this.title = "Die on ";
                    break;

                case FlightLog.EntryType.Escape:
                    this.title += "an escape from";
                    break;

                case FlightLog.EntryType.ExitVessel:
                    this.title = "Exit a vessel on ";
                    break;

                case FlightLog.EntryType.Flight:
                    this.title += "a flight on ";
                    break;

                case FlightLog.EntryType.Flyby:
                    this.title += "a flyby of ";
                    break;

                case FlightLog.EntryType.Land:
                    this.title += "a landing on ";
                    break;

                case FlightLog.EntryType.Launch:
                    this.title += "a launch from ";
                    break;

                case FlightLog.EntryType.Orbit:
                    this.title += "an orbit of ";
                    break;

                case FlightLog.EntryType.PlantFlag:
                    this.title = "Plant a flag on ";
                    break;

                case FlightLog.EntryType.Recover:
                    this.title += " a recovery on ";
                    break;

                case FlightLog.EntryType.Spawn:
                    this.title = "Spawn on ";
                    break;

                case FlightLog.EntryType.Suborbit:
                    this.title += "a sub-orbital trajectory of ";
                    break;
                }
                if (destination != null)
                {
                    if (destination.name == "Mun")
                    {
                        this.title += "the ";
                    }
                    this.title += destination.name;
                }
            }
            else
            {
                this.title = title;
            }
            this.destination = destination;
            this.entryType   = entryType;
        }
        public override bool Load(ConfigNode configNode)
        {
            // Load base class
            bool valid = base.Load(configNode);

            valid &= ConfigNodeUtil.ParseValue <FlightLog.EntryType>(configNode, "situation", x => situation = x, this);
            valid &= ValidateTargetBody(configNode);

            LoggingUtil.LogWarning(this, "VesselHasVisited is obsolete as of Contract Configurator 0.7.5 and will be removed in 1.0.0.  Please use Orbit or ReachState (with disableOnStateChange = true) instead.");

            return(valid);
        }