コード例 #1
0
        public Exception WriteSaveGame(string gamePath)
        {
            _game.ModifyVariables();

            var result = _game.WriteSaveGame(gamePath, true);

            return(!result?QSPGameWorld.GetLastError() : null);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            QSPGameWorld QSP = new QSPGameWorld();

            Console.WriteLine($"QSP Lib version : {QSP.Version}");
            Console.WriteLine($"Compiled on {QSP.CompiledDate}");

            if (QSP.LoadGameWorld(@"c:\temp\test2.qsp"))
            {
                if (QSP.OpenSavedGame(@"C:\temp\test2.sav", true))
                {
                    /*foreach(QSPVariable var in QSP.VariablesList)
                     * {
                     *  Console.WriteLine(var.ToString());
                     * }*/

                    /*if ( QSP.RestartWorld(true) )
                     * {
                     *  string location;
                     *  int index;
                     *  int line;
                     *  QSP.GetCurrentStateData(out location, out index, out line);
                     *  Console.WriteLine($"{location}{index}{line}");
                     * }*/

                    Console.WriteLine($"{QSP.LocationsCount}");

                    for (int i = 0; i < QSP.LocationsCount; i++)
                    {
                        Console.WriteLine($"{QSP.GetLocationName(i)}");
                    }

                    foreach (var variable in QSP.ActionList)
                    {
                        Console.WriteLine($"{variable.Index} - {variable.ImagePath} - {variable.Description}");
                    }

                    foreach (var variable in QSP.ObjectList)
                    {
                        Console.WriteLine($"{variable.Index} - {variable.ImagePath} - {variable.Description}");
                    }
                }
            }
            else
            {
                Console.WriteLine("cant load");
            }

            Console.ReadKey();
        }
コード例 #3
0
        public Exception LoadSave(string savepath)
        {
            var result = _game.OpenSavedGame(savepath, true);

            return(!result?QSPGameWorld.GetLastError() : null);
        }
コード例 #4
0
        public Exception OpenGame(string gamePath)
        {
            var result = _game.LoadGameWorld(gamePath);

            return(!result?QSPGameWorld.GetLastError() : null);
        }
コード例 #5
0
 public QSPGameDataService()
 {
     _game = new QSPGameWorld();
 }