Ejemplo n.º 1
0
 void OnSeatUpdated(object sender, SeatEventArgs e)
 {
     if (InvokeRequired)
     {
         // We're not in the UI thread, so we need to call BeginInvoke
         BeginInvoke(new EventHandler<SeatEventArgs>(OnSeatUpdated), new[] { sender, e });
         return;
     }
     SuspendLayout();
     if( e.Seat.IsEmpty)
         m_Huds[e.Seat.NoSeat].Visible = false;
     else
         InstallPlayer(m_Huds[e.Seat.NoSeat], e.Seat);
     ResumeLayout();
 }
Ejemplo n.º 2
0
 void OnSeatUpdated_Console(object sender, SeatEventArgs e)
 {
     if (InvokeRequired)
     {
         // We're not in the UI thread, so we need to call BeginInvoke
         BeginInvoke(new EventHandler<SeatEventArgs>(OnSeatUpdated_Console), new[] { sender, e });
         return;
     }
     var s = e.Seat;
     if(e.Seat.IsEmpty)
         WriteLine("The seat #" + s.NoSeat + " is now inoccupied");
     else
         WriteLine(s.Player.Name + " sat in at seat #" + s.NoSeat);
 }
Ejemplo n.º 3
0
        void OnSeatUpdated(object sender, SeatEventArgs e)
        {
            if (e.Seat.IsEmpty || Player.NoSeat != e.Seat.NoSeat)
            {
                if (!e.Seat.IsEmpty)
                    PepareCardsForSending(e.Seat);

                Send(new SeatUpdatedCommand()
                {
                    Seat = e.Seat,
                });
            }
        }