Ejemplo n.º 1
0
        public Task <bool> LoadGameStateAsync(byte[] stateData)
        {
            if (CoreRunner == null)
            {
                return(Task.FromResult(false));
            }

            return(CoreRunner.LoadGameStateAsync(stateData).AsTask());
        }
Ejemplo n.º 2
0
        public async Task <bool> LoadGameStateAsync(uint slotID)
        {
            var success = false;

            if (CoreRunner == null)
            {
                return(success);
            }

            SaveStateService.SetGameId(GameID);
            using (var stream = await SaveStateService.GetStreamForSlotAsync(slotID, FileAccess.Read))
            {
                if (stream == null)
                {
                    return(false);
                }

                success = await CoreRunner.LoadGameStateAsync(stream);
            }

            return(success);
        }