Esempio n. 1
0
 private void Init(STUGameRulesetSchema ruleset, ulong key = default)
 {
     GUID    = teResourceGUID.AsString(key);
     Name    = GetString(ruleset.m_displayText);
     Entries = ruleset.m_entries?.Select(x => new GameRulesetSchemaEntry(x)).ToArray();
 }
Esempio n. 2
0
            private string DumpGUID(IndentHelper indentHelper, ulong guid)
            {
                string baseString = $"\r\n{indentHelper + 1}[{GetGUIDTypeName(guid)}]";

                STUInstance[] instances;
                switch (GUID.Type(guid))
                {
                default:
                    return("");

                case 0x7C:
                case 0xA9:
                    return($"{baseString} \"{GetOWString(guid, _handler, _map)}\"");

                case 0x90:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STUEncryptionKey encryptionKey = instances[0] as STUEncryptionKey;
                    return($"{baseString} {encryptionKey?.KeyNameProper}:{encryptionKey?.Key}");

                case 0xA5:
                    instances = GetInstances(guid, _handler, _map);
                    STUUnlock unlock      = instances.OfType <STUUnlock>().First();
                    string    baseString2 = $"\r\n{indentHelper + 1}[{GetGUIDTypeName(guid)}";
                    if (unlock == null)
                    {
                        return(null);
                    }
                    if (unlock is STUUnlock_Currency)
                    {
                        return($"{baseString2}:Credits] {(unlock as STUUnlock_Currency).Amount} Credits");
                    }
                    else if (unlock is STULevelPortrait)
                    {
                        STULevelPortrait portrait = unlock as STULevelPortrait;
                        return
                            ($"{baseString2}:Credits] {portrait.Tier} Star:{portrait.Star} Level:{portrait.Level}");
                    }
                    else if (unlock is STUCompetitiveCurrencyReward)
                    {
                        STUCompetitiveCurrencyReward competitiveCurrencyReward = unlock as STUCompetitiveCurrencyReward;
                        return
                            ($"{baseString2}:CompetitivePoints] {competitiveCurrencyReward.Amount} points");
                    }
                    else
                    {
                        return($"{baseString2}:{unlock.GetType().Name}] \"{GetOWString(unlock.CosmeticName, _handler, _map)}\"");
                    }

                case 0x9E:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STULoadout ability = instances[0] as STULoadout;
                    return($"{baseString} \"{GetOWString(ability?.Name, _handler, _map)}\" ({ability?.Category})");

                case 0xC5:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STUGamemode gamemode = instances[0] as STUGamemode;
                    return($"{baseString} \"{GetOWString(gamemode?.DisplayName, _handler, _map)}\"");

                case 0xC6:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STUGameRulesetSchema gameRulsetSchema = instances[0] as STUGameRulesetSchema;
                    return($"{baseString} \"{GetOWString(gameRulsetSchema?.Name, _handler, _map)}\"");

                case 0x75:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STUHero hero = instances[0] as STUHero;
                    return($"{baseString} \"{GetOWString(hero?.Name, _handler, _map)}\"");
                }
            }
Esempio n. 3
0
 public GameRulesetSchema(STUGameRulesetSchema stu, ulong key = default)
 {
     Init(stu, key);
 }
Esempio n. 4
0
 public GameRulesetSchema(STUGameRulesetSchema ruleset, ulong key)
 {
     GUID    = teResourceGUID.AsString(key);
     Name    = GetString(ruleset.m_displayText);
     Entries = ruleset.m_entries != null?ruleset.m_entries.Select(x => new GameRulesetSchemaEntry(x)) : Enumerable.Empty <GameRulesetSchemaEntry>();
 }