Ejemplo n.º 1
0
        public App()
        {
            InitializeComponent();

            var page = new STG_RestaurantBuzzer.MainPage();

            page.TableReady += () => TableReady?.Invoke();

            MainPage = page;
        }
Ejemplo n.º 2
0
    private void SendTableReady()
    {
        var userTableData = new TableReady()
        {
            cmd            = "table",
            user_id        = UIManager.CurrentUser.user_id,
            game_id        = UIManager.GameId,
            intact_cells   = defense.OccupiedNumber,
            occupied_cells = defense.OccupiedCells
        };
        string userTableString = JsonUtility.ToJson(userTableData);

        Byte[] sendBytes = Encoding.UTF8.GetBytes(userTableString);
        Debug.Log("Sending TableReady!!");
        udp.Send(sendBytes, sendBytes.Length);
    }
Ejemplo n.º 3
0
        private bool RefreshParties()
        {
            var tableReady = false;

            _groups.Clear();
            foreach (var party in _partyRepository.WaitingParties())
            {
                _groups.Add(party);
                if (party.Id == _myParty?.Id && party.WaitMinutes == 0)
                {
                    TableReady?.Invoke();
                    tableReady = true;
                }
            }

            return(!tableReady);
        }
Ejemplo n.º 4
0
        public ActionResult TableReady([FromBody] TableReady tableReady)
        {
            IeventBus.PublishEvent("tableReady", tableReady);

            return(new JsonResult(tableReady));
        }