public int m_FoodID          = -1;                                              // 食材的ID

        public void Rest()
        {
            m_IsActive       = false;
            m_DeskFinishTime = 0;
            for (int i = 0; i < m_GuestIDs.Length; i++)
            {
                m_GuestIDs[i] = -1;
            }
            m_DestState = DeskState.None;
            m_FoodID    = -1;
        }
        public void SetDeskState(string deskName, DeskState newState)
        {
            var desk = _deskStorage.GetDesk(deskName);
            if (desk.State == newState)
            {
                throw new DeskLogicException(string.Format("Desk {0} already has the state {1}", deskName, newState));
            }

            if (newState == DeskState.Voting)
            {
                foreach (var user in desk.Users)
                {
                    user.Card = null;
                }
            }

            desk.State = newState;
            desk.Timestamp = DateTime.UtcNow;
            _deskStorage.UpdateDesk(desk);
        }
        public void SetDeskState(string deskName, DeskState newState)
        {
            var desk = _deskStorage.GetDesk(deskName);

            if (desk.State == newState)
            {
                throw new DeskLogicException(string.Format("Desk {0} already has the state {1}", deskName, newState));
            }

            if (newState == DeskState.Voting)
            {
                foreach (var user in desk.Users)
                {
                    user.Card = null;
                }
            }

            desk.State     = newState;
            desk.Timestamp = DateTime.UtcNow;
            _deskStorage.UpdateDesk(desk);
        }
Exemple #4
0
        private void SetDeskState(ActivityDesk.DeskState deskState)
        {
            this._deskState = deskState;

            this.Dispatcher.Invoke(DispatcherPriority.Background, new System.Action(() =>
            {
                this.Background = (ImageBrush)this.Resources["back"];
            }));
        }
 public void Post(string id, [FromBody] DeskState newState)
 {
     _deskProvider.SetDeskState(id, newState);
 }
Exemple #6
0
 public DeskStateChangedEventArgs(DeskState newDeskState)
 {
     NewDeskState = newDeskState;
 }