Пример #1
0
        public EnumCollator(IEnumerable <EnumElement> enums, IEnumerable <TypeElement> types, NameFormatter nameFormatter)
        {
            this.enums = enums.ToDictionary(x => x.VkName);
            this.types = types.ToDictionary(x => x.VkName);

            this.nameFormatter = nameFormatter;

            var enumTypes = this.enums.Select(x => x.Key).ToList();

            var bitmaskTypes = new List <TypeElement>();

            foreach (var bitmaskType in types.Where(x => x.Category == TypeCategory.bitmask))
            {
                bitmaskTypes.Add((bitmaskType));

                if (bitmaskType.Requires != null)
                {
                    enumTypes.Remove(bitmaskType.Requires);
                }
            }

            enumTypes.Remove("API Constants");

            this.enumTypes    = enumTypes;
            this.bitmaskTypes = bitmaskTypes;
        }
Пример #2
0
        public TypeCollator(IEnumerable <TypeElement> types, NameFormatter nameFormatter)
        {
            this.types         = types;
            this.nameFormatter = nameFormatter;

            this.handleTypes = this.types.Where(x => x.Category == TypeCategory.handle)
                               .Select(x => x.VkName)
                               .ToArray();
        }
Пример #3
0
 public DelegateCollator(IEnumerable <TypeElement> types, NameFormatter nameFormatter)
 {
     this.delegateTypes = types.Where(x => x.Category == TypeCategory.funcpointer);
     this.nameFormatter = nameFormatter;
 }
Пример #4
0
 public CommandCollator(IEnumerable <CommandElement> commands, IEnumerable <CommandRequirement> requirements, NameFormatter nameFormatter, IEnumerable <TypeElement> types)
 {
     this.commands      = commands;
     this.requirements  = requirements.Distinct().ToDictionary(x => x.CommandName);
     this.nameFormatter = nameFormatter;
     this.typeData      = types.ToDictionary(x => x.VkName);
 }
Пример #5
0
 public ConstantCollator(IEnumerable <EnumElement> enums, NameFormatter nameFormatter)
 {
     this.constantsEnum = enums.Single(x => x.VkName == "API Constants");
     this.nameFormatter = nameFormatter;
 }
Пример #6
0
 public CommandCollator(IEnumerable <CommandElement> commands, NameFormatter nameFormatter, IEnumerable <TypeElement> types)
 {
     this.commands      = commands;
     this.nameFormatter = nameFormatter;
     this.typeData      = types.ToDictionary(x => x.VkName);
 }