private void CommandsCanExecuteChange() { DealCommand.RaiseCanExecuteChanged(); HitCommand.RaiseCanExecuteChanged(); StayCommand.RaiseCanExecuteChanged(); //SplitCommand.RaiseCanExecuteChanged(); MakeWagerCommand.RaiseCanExecuteChanged(); }
public Commands(GameViewModel viewModel) { DealCommand = new DealCommand(viewModel); HitCommand = new HitCommand(viewModel); StandCommand = new StandCommand(viewModel); SplitCommand = new SplitCommand(viewModel); RulesCommand = new RulesCommand(viewModel); HitLeftCommand = new HitLeftCommand(viewModel); StandLeftCommand = new StandLeftCommand(viewModel); HitRightCommand = new HitRightCommand(viewModel); StandRightCommand = new StandRightCommand(viewModel); }
public ActionResult Index() { var deal_command = new DealCommand() { player_token = _player_authenticator.get_player_token() }; DomainEvents.register_temp_event_handler <HandResultEvent>(e => this.FlashInfo(e.message)); _command_bus.send(deal_command); return(RedirectToAction("Display", "BlackJackTableGameView")); }
public String Test([FromForm][FromBody] DealCommand dealCommand) { if (dealCommand == null) { return("不能为空!"); } var body = JsonHelper.Serialize(dealCommand); //仅作为测试,视频处理需要时间很长,相关逻辑可以在回调中实现, //事件总线研究中,后续实现源和处理的解耦 var response = _rpcClient.Call(body); return(response); }
static void Main(string[] args) { var rpcClient = new RpcClient(); DealCommand dealCommand = new DealCommand() { All = true }; var body = JsonHelper.Serialize(dealCommand); Console.WriteLine($" [x] Requesting {body}"); var response = rpcClient.Call(body); Console.WriteLine(" [.] Got '{0}'", response); rpcClient.Close(); Console.WriteLine(" Press [enter] to exit."); Console.ReadLine(); }
static String Dealed(DealCommand dealCommand) { /* * 逻辑如下: * ①获取路径,拆分 roomID、userID、CreateTricks * ②根据dealCommand:a:all,该房间下所有用户;b:房间号+userIDs+tricks * ③返回处理后的路径 */ List<String> listPath = new List<string>(); List<JanusRecordMedia> janusRecordMedias = new List<JanusRecordMedia>(); List<String> listDealedPath = new List<string>(); Directory.GetFiles("/test") .Where(x => Path.GetExtension(x) == ".mjr").ToList()? .ForEach(x => { var media = x.Split('-'); janusRecordMedias.Add(new JanusRecordMedia() { FileName = x, RoomID = media[1], UserID = media[3], CreateTricks = Int64.TryParse(media[5][0..^3], out long result) ? result : DateTime.UtcNow.Ticks