Example #1
0
 public static async Task Initialize(IGGDBFDataSource source)
 {
     Instance = new()
     {
         Skill  = await source.RetrieveTableAsync <TSkillType, DBRPGSkill <TSkillType> >(new NameOverrideTableRetrievalConfig <TSkillType, DBRPGSkill <TSkillType> >("Skill")),
         Race   = await source.RetrieveTableAsync <TRaceType, DBRPGRace <TRaceType> >(new NameOverrideTableRetrievalConfig <TRaceType, DBRPGRace <TRaceType> >("Race")),
         @Class = await source.RetrieveTableAsync <TClassType, DBRPGClass <TClassType> >(new NameOverrideTableRetrievalConfig <TClassType, DBRPGClass <TClassType> >("Class")),
         CharacterCustomizationSlotType = await source.RetrieveTableAsync <TCustomizableSlotType, DBRPGCharacterCustomizableSlotType <TCustomizableSlotType> >(new NameOverrideTableRetrievalConfig <TCustomizableSlotType, DBRPGCharacterCustomizableSlotType <TCustomizableSlotType> >("CharacterCustomizationSlotType")),
         CharacterProportionSlotType    = await source.RetrieveTableAsync <TProportionSlotType, DBRPGCharacterProportionSlotType <TProportionSlotType> >(new NameOverrideTableRetrievalConfig <TProportionSlotType, DBRPGCharacterProportionSlotType <TProportionSlotType> >("CharacterProportionSlotType")),
         Stat = await source.RetrieveTableAsync <TStatType, DBRPGStat <TStatType> >(new NameOverrideTableRetrievalConfig <TStatType, DBRPGStat <TStatType> >("Stat")),
         CharacterStatDefault = await source.RetrieveTableAsync <DBRPGCharacterStatDefaultKey <TStatType, TRaceType, TClassType>, DBRPGCharacterStatDefault <TStatType, TRaceType, TClassType>, RPGStaticDataContext_DBRPGCharacterStatDefault <TSkillType, TRaceType, TClassType, TProportionSlotType, TCustomizableSlotType, TStatType> >(new NameOverrideTableRetrievalConfig <DBRPGCharacterStatDefaultKey <TStatType, TRaceType, TClassType>, DBRPGCharacterStatDefault <TStatType, TRaceType, TClassType> >("CharacterStatDefault") { KeyResolutionFunction = m => new DBRPGCharacterStatDefaultKey <TStatType, TRaceType, TClassType>(m.Level, m.RaceId, m.ClassId) }),
     };
 }
Example #2
0
        static async Task Main(string[] args)
        {
            try
            {
                var dataSource = new RefitHttpGGDBFDataSource <RPGStaticDataContext <TestSkillType, TestRaceType, TestClassType, TestProportionSlotType, TestCustomizationSlotType, TestStatType> >($@"https://localhost:5001/", new RefitHttpGGDBFDataSourceOptions(true));
                var tables     = await dataSource.RetrieveTableAsync <DBRPGCharacterStatDefaultKey <TestStatType, TestRaceType, TestClassType>, DBRPGCharacterStatDefault <TestStatType, TestRaceType, TestClassType>, RPGStaticDataContext_DBRPGCharacterStatDefault <TestSkillType, TestRaceType, TestClassType, TestProportionSlotType, TestCustomizationSlotType, TestStatType> >();

                Console.WriteLine($"Meep");

                await RPGStaticDataContext <TestSkillType, TestRaceType, TestClassType, TestProportionSlotType, TestCustomizationSlotType, TestStatType> .Initialize(dataSource);

                Console.WriteLine(RPGStaticDataContext <TestSkillType, TestRaceType, TestClassType, TestProportionSlotType, TestCustomizationSlotType, TestStatType> .Instance.Class.Count);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.ReadKey();
        }