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 = ResourceValue.PartsToList(partList);
                break;

            case "PARTS":
                list = PartValue.PartsToList(partList, sharedObj);
                break;

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

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

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

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