예제 #1
0
        static void Main(string[] args)
        {
            //var connectionString = new FbConnectionStringBuilder
            //{
            //    Database = @"D:\SteamLibrary\SteamApps\common\SuperPower 2\MODS\SP2\data\DATABASE2.GDB",
            //    ServerType = FbServerType.Embedded,
            //    UserID = "SYSDBA",
            //    Password = "******",
            //    ClientLibrary = "fbembed.dll"
            //}.ToString();

            ////var dbContextOptions = new DbContextOptionsBuilder().UseFirebird(connectionString).Options;

            //SuperPowerEditorDbContext context = new SuperPowerEditorDbContext(connectionString);

            //IQueryable<Design> queryable = context.Designs.Include(design => design.CountryDesignerRef).Where(design => design.CountryDesigner == 177);

            //var sql = queryable.ToSql();

            //List<Design> designs = queryable.ToList();

            var spStringTable = new SpStringTable();

            spStringTable.Load(@"D:\Temp\SP2\data");
        }
예제 #2
0
        public ModStringTableActor(ModMetadata modMetadata)
        {
            var dataPath      = modMetadata.DataPath;
            var spStringTable = new SpStringTable();

            spStringTable.Load(dataPath);

            Receive <LoadStringTableValueFromIdCommand>(command =>
            {
                try
                {
                    string spString = spStringTable.GetString(command.StId, command.Lang);

                    //string spString = "Deniz";

                    Sender.Tell(new StringTableValueLoadedEvent(command.StId, spString, command.Lang), Self);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    throw;
                }
            });
        }