Esempio n. 1
0
        public override bool Execute(List <string> args)
        {
            var searchClasses = ArgumentParser.ParseTagClasses(_cache, args);

            if (searchClasses == null)
            {
                return(false);
            }

            TagInstance[] tags;
            if (args.Count > 0)
            {
                tags = _cache.Tags.FindAllInGroups(searchClasses).ToArray();
            }
            else
            {
                tags = _cache.Tags.NonNull().ToArray();
            }

            if (tags.Length == 0)
            {
                Console.Error.WriteLine("No tags found.");
                return(true);
            }
            TagPrinter.PrintTagsShort(tags);
            return(true);
        }
        private bool ExecuteListDependsOn(HaloTag tag)
        {
            var dependsOn = _cache.Tags.Where(t => t != null && t.Dependencies.Contains(tag.Index));

            TagPrinter.PrintTagsShort(dependsOn);
            return(true);
        }
        private bool ExecuteListDependsOn(TagInstance tag)
        {
            var dependsOn = _cache.Tags.NonNull().Where(t => t.Dependencies.Contains(tag.Index));

            TagPrinter.PrintTagsShort(dependsOn);
            return(true);
        }
        private bool ExecuteList(HaloTag tag, bool all)
        {
            if (tag.Dependencies.Count == 0)
            {
                Console.Error.WriteLine("Tag {0:X8} has no dependencies.", tag.Index);
                return(true);
            }
            IEnumerable <HaloTag> dependencies;

            if (all)
            {
                dependencies = _cache.Tags.FindDependencies(tag);
            }
            else
            {
                dependencies = tag.Dependencies.Where(i => _cache.Tags.Contains(i)).Select(i => _cache.Tags[i]);
            }
            TagPrinter.PrintTagsShort(dependencies);
            return(true);
        }