Example #1
0
        public static ListValue PartList(this IShipconstruct vessel, string partType, SharedObjects sharedObj)
        {
            var list     = new ListValue();
            var partList = vessel.Parts.ToList();

            switch (partType.ToUpper())
            {
            case "RESOURCES":
                list = AggregateResourceValue.PartsToList(partList, sharedObj);
                break;

            case "PARTS":
                list = PartValueFactory.Construct(partList, sharedObj);
                break;

            case "ENGINES":
                list = EngineValue.PartsToList(partList, sharedObj);
                break;

            case "RCS":
                list = RCSValue.PartsToList(partList, sharedObj);
                break;

            case "SENSORS":
                list = SensorValue.PartsToList(partList, sharedObj);
                break;

            case "ELEMENTS":
                list = ElementValue.PartsToList(partList, sharedObj);
                break;

            case "DOCKINGPORTS":
                list = DockingPortValue.PartsToList(partList, sharedObj);
                break;

            case "DECOUPLERS":
            case "SEPARATORS":
                list = DecouplerValue.PartsToList(partList, sharedObj);
                break;
            }
            return(list);
        }
Example #2
0
 private void InitializeSuffixes()
 {
     AddSuffix("NAME", new SetSuffix <StringValue>(() => dockedVesselInfo.name, SetName));
     AddSuffix("UID", new Suffix <StringValue>(() => dockedVesselInfo.rootPartUId.ToString()));
     AddSuffix("VESSEL", new Suffix <VesselTarget>(() => VesselTarget.CreateOrGetExisting(parts[0].vessel, shared)));
     AddSuffix("PARTS", new Suffix <ListValue>(() => PartValueFactory.Construct(parts, shared)));
     AddSuffix("DOCKINGPORTS", new Suffix <ListValue>(() => DockingPortValue.PartsToList(parts, shared)));
     AddSuffix(new string[] { "DECOUPLERS", "SEPARATORS" }, new Suffix <ListValue>(() => DecouplerValue.PartsToList(parts, shared)));
     AddSuffix("RESOURCES", new Suffix <ListValue>(GetResourceManifest));
 }