using System.ComponentModel; using JD.Asset.Types.Map; using JD.Collections.Extensions; using JD.Core.ProjectManaging; using Packager.Parameters; using TeaBox; namespace Packager.Tasks { [DisplayName("Extract maps from the files' name")] [Description("Extracts the map main scene files specified from the list of files, that can b anywhere in the map folder")] public class ExtractMapsFromFileNames : Task { [Input("File List to extract the map from", IOCardinality.Multi, IOType.String)] public ReferenceList FileList { get; set; } [Output("maps' main scene file list", IOType.String)] public ReferenceList MapSceneFiles = new ReferenceList(); public ExtractMapsFromFileNames() { FileList = new ReferenceList(); } protected override void StartInternal(BuildConfiguration profile, cookerWrapper cooker) { FileList.ForEach(x => { var map = Map.FromPath(x); if (!Equals(map, Map.Empty)) { MapSceneFiles.Add(DataPath.GetRelativePath(map.MainScenePath)); } }); } } }