Пример #1
0
        private async Task PushRollbackSnapshotAsync(Commands.Command executedCommand)
        {
            var state = new GameStateMap();

            state.SaveDateTime = DateTime.Now;

            await SaveAllServicesToStateAsync <IStatefulService <GameStateMap>, GameStateMap>(state);

            foreach (var task in onGameSerializeTasks)
            {
                await task(state);
            }

            rollbackStateStack.Push(state);
        }
Пример #2
0
        private void HighlightPlayedCommand(Commands.Command command)
        {
            if (!ObjectUtils.IsValid(scriptAsset) || command is null || command.ScriptName != scriptAsset.name || !lines.IsIndexValid(command.LineIndex) || !ViewRange.Contains(command.LineIndex))
            {
                return;
            }

            var prevPlayedLine = linesContainer.Q <ScriptLineView>(className: playedLineClass);

            prevPlayedLine?.RemoveFromClassList(playedLineClass);

            var playedLine = lines[command.LineIndex];

            playedLine.AddToClassList(playedLineClass);
        }
Пример #3
0
 private UniTask HandleCommandPreExecution(Commands.Command _)
 {
     PushRollbackSnapshot(false);
     return(UniTask.CompletedTask);
 }