Beispiel #1
0
 internal static CommandSet Parse(IniParser parser)
 {
     return(parser.ParseTopLevelNamedBlock(
                (x, name) => x.Name = name,
                new IniArbitraryFieldParserProvider <CommandSet>(
                    (x, name) => x.Buttons[int.Parse(name)] = parser.ParseAssetReference())));
 }
Beispiel #2
0
 internal static CrateObject Parse(IniParser parser)
 {
     return(new CrateObject
     {
         ObjectName = parser.ParseAssetReference(),
         Probability = parser.ParseFloat()
     });
 }
Beispiel #3
0
 internal static TerrainObject Parse(IniParser parser)
 {
     return(new TerrainObject
     {
         Name = parser.ParseAssetReference(),
         Unknown = parser.ParseInteger()
     });
 }
Beispiel #4
0
 internal static AttackPriorityTarget Parse(IniParser parser)
 {
     return(new AttackPriorityTarget
     {
         Target = parser.ParseAssetReference(),
         Value = parser.ParseInteger()
     });
 }
Beispiel #5
0
 internal static ModifierUpgrade Parse(IniParser parser)
 {
     return(new ModifierUpgrade
     {
         Upgrade = parser.ParseAssetReference(),
         Delay = parser.ParseAttributeInteger("Delay")
     });
 }
Beispiel #6
0
 internal static Payload Parse(IniParser parser)
 {
     return(new Payload
     {
         Name = parser.ParseAssetReference(),
         Quantity = (int)(parser.NextTokenIf(IniTokenType.IntegerLiteral)?.IntegerValue ?? 1)
     });
 }
Beispiel #7
0
 internal static FXParticleSysBoneNugget Parse(IniParser parser)
 {
     return(new FXParticleSysBoneNugget
     {
         Bone = parser.ParseBoneName(),
         Particle = parser.ParseAssetReference(),
         FollowBone = parser.ParseAttributeBoolean("FollowBone")
     });
 }
Beispiel #8
0
        private static string ParseVeterancyAssetReference(IniParser parser)
        {
            var tokenPosition = parser.CurrentPosition;
            var identifier    = parser.ParseIdentifier();

            if (identifier != "HEROIC")
            {
                throw new IniParseException($"Unexpected identifier: {identifier}", tokenPosition);
            }
            return(parser.ParseAssetReference());
        }
Beispiel #9
0
        internal static Payload Parse(IniParser parser)
        {
            var result = new Payload
            {
                Name     = parser.ParseAssetReference(),
                Quantity = 1
            };

            var quantityToken = parser.GetNextTokenOptional();

            if (quantityToken != null)
            {
                result.Quantity = parser.ScanInteger(quantityToken.Value);
            }

            return(result);
        }
Beispiel #10
0
        internal static ModifierUpgrade Parse(IniParser parser)
        {
            var upgrades = new List <string>();
            var token    = parser.PeekNextTokenOptional();

            while (token.HasValue && !token.Value.Text.Contains(":"))
            {
                upgrades.Add(parser.ParseAssetReference());
                token = parser.PeekNextTokenOptional();
            }

            return(new ModifierUpgrade
            {
                Upgrades = upgrades.ToArray(),
                Delay = parser.ParseAttributeInteger("Delay")
            });
        }
Beispiel #11
0
 internal static LivingWorldCampaignActDespawnArmy Parse(IniParser parser) => new LivingWorldCampaignActDespawnArmy
 {
     Name = parser.ParseAssetReference()
 };