Esempio n. 1
0
 private static void ProcessCommand(CommandReplay message)
 {
     Console.WriteLine();
     Console.WriteLine(message.Command.ToString());
     foreach (Player p in message.Players)
     {
         Console.WriteLine(p.Name + " " + p.Ammount);
     }
 }
Esempio n. 2
0
        private CommandReplay GenerateCommandReplay(PokerCommand command)
        {
            var list = _gameProvider.GetAllPlayers();

            CommandReplay commandReplay = new CommandReplay();

            commandReplay.Command = command;
            commandReplay.Players.AddRange(list);

            return(commandReplay);
        }
Esempio n. 3
0
    // Start is called before the first frame update
    public void Start()
    {
        base.Start();
        //Bind keys with commands
        buttonB = new CommandNothing();

        buttonW = new MoveForward();
        buttonS = new MoveReverse();
        buttonA = new MoveLeft();
        buttonD = new MoveRight();

        buttonZ = new CommandUndo();
        buttonR = new CommandReplay();
    }
Esempio n. 4
0
        public async Task BroadcastCommandAsync(CommandRequest command)
        {
            try
            {
                CommandReplay com  = GenerateCommandReplay(command.CommandId);
                var           list = _gameProvider.GetAllPlayers();

                foreach (var player in list)
                {
                    await playerStreamlist[player.Id].Stream.WriteAsync(com);
                }
            }
            catch (Exception ex)
            { }
        }
Esempio n. 5
0
 public RESULT loadCommandReplay(string path, COMMANDREPLAY_FLAGS flags, out CommandReplay replay)
 {
     replay = null;
     IntPtr newPtr = new IntPtr();
     RESULT result = FMOD_Studio_System_LoadCommandReplay(rawPtr, Encoding.UTF8.GetBytes(path + Char.MinValue), flags, out newPtr);
     if (result == RESULT.OK)
     {
     replay = new CommandReplay(newPtr);
     }
     return result;
 }
        public SkillReplayControlViewModel()
        {
            replayer = new SkillPlayer(this);

            var config = SkillReplayConfig.Instance;

            Language      = new ReactiveProperty <string>(config.Language);
            TextFFLogsURL = new ReactiveProperty <string>(config.FFLogsURL);
            NumberPort    = new ReactiveProperty <int>(config.Port);
            AutoReplay    = new ReactiveProperty <int>(config.AutoReplay);
            AutoStop      = new ReactiveProperty <int>(config.AutoStop);
            AutoStopTime  = new ReactiveProperty <int>(config.AutoStopTime);
            LanguageList  = config.LanguageList;

            TextPlayButton = IsPlaying.Select(play => play ? "停止" : "再生").ToReactiveProperty();
            OverlayURL     = NumberPort.Select(port => $"https://rawrington.github.io/SkillDisplay/?HOST_PORT=ws://127.0.0.1:{port}/").ToReactiveProperty();


            var IsBusy = new[] { IsLoading, IsPlaying }.CombineLatest(a => a.Any(x => x));

            HasEvent = CurrentFight.CombineLatest(CurrentFriendly, CheckEvents).ToReactiveProperty();

            FriendlyList = OriginalFriendlyList.CombineLatest(CurrentFight, (list, fight) =>
            {
                if (fight != null)
                {
                    string key = $".{fight.id}.";
                    return(list.Where(friend => friend.fights.Contains(key) && friend.type != "LimitBreak").ToList());
                }
                else
                {
                    return(new List <Friendly>());
                }
            }).ToReactiveProperty();

            FriendlyList.Subscribe(list =>
            {
                if (!list.Contains(CurrentFriendly.Value))
                {
                    CurrentFriendly.Value = null;
                }
            });

            CommandLoadFights = IsBusy.Select(b => !b).ToReactiveCommand();
            CommandLoadFights.Subscribe(LoadFights);

            CommandLoadSkill = CurrentFight.CombineLatest(CurrentFriendly, IsBusy, (fight, friend, busy) =>
            {
                if (busy)
                {
                    return(false);
                }
                if (fight == null)
                {
                    return(false);
                }
                if (friend == null)
                {
                    return(false);
                }
                return(true);
            }).ToReactiveCommand();
            CommandLoadSkill.Subscribe(LoadEvents);

            CommandReplay = HasEvent.ToReactiveCommand();
            CommandReplay.Subscribe(Replay);

            TextFFLogsURL.Subscribe(url =>
            {
                config.FFLogsURL = url;
                config.Save();
            });
            NumberPort.Subscribe(port =>
            {
                config.Port = port;
                config.Save();
            });
            AutoReplay.Subscribe(autoreplay =>
            {
                config.AutoReplay = autoreplay;
                config.Save();
            });
            AutoStop.Subscribe(autostop =>
            {
                config.AutoStop = autostop;
                config.Save();
            });
            AutoStopTime.Subscribe(autostoptime =>
            {
                config.AutoStopTime = autostoptime;
                config.Save();
            });

            Language.Subscribe(lang =>
            {
                config.Language = lang;
                config.Save();
            });

            PlayStopTagList = IsPlaying.Select(x => x ? "Stop" : "Play").ToReactiveProperty();
        }