Beispiel #1
0
        public void SetupUi()
        {
            Agent.CurrentPlayerAgent.Subscribe(player =>
            {
                WhiteEndButton.interactable = player.Color == EColor.White;
                BlackEndButton.interactable = player.Color == EColor.Black;
            });

            var whiteAgent = WhitePlayerView.Agent;
            var blackAgent = BlackPlayerView.Agent;
            var white      = whiteAgent.Model;
            var black      = blackAgent.Model;

            WhiteEndButton.Bind(() => whiteAgent.PushRequest(new TurnEnd(white), TurnEnded));
            BlackEndButton.Bind(() => blackAgent.PushRequest(new TurnEnd(black), TurnEnded));

            Agent.LastResponse.Subscribe(
                (r) =>
            {
                ResponseText.text = $"{r}";
                _gameRoot.CheckAllValid();
            }
                );
        }