예제 #1
0
 public void UpdateYourField(int x, int y, battleship_client.BattleshipServerRef.Cell state)
 {
     Rectangle cell = (Rectangle)FindName(string.Format("mycell{0}", x + y * 10));
     Style style = this.FindResource(state == Cell.DeadShip ? "DeadShipCell" :
         state == Cell.Empty ? "EmptyCell" :
         state == Cell.Fire ? "FireCell" :
         state == Cell.Missed ? "MissedCell" :
         "ShipCell") as Style;
     cell.Style = style;
 }
예제 #2
0
 public void UpdateYourField(int x, int y, battleship_client.BattleshipServerRef.Cell state)
 {
     if ((Content as GamePage) != null)
     {
         (Content as GamePage).UpdateYourField(x, y, state);
     }
 }
예제 #3
0
        public void TransferMessage(battleship_client.BattleshipServerRef.Message message)
        {
            string mess = "[" + message.Author + "," + message.CreationTime.ToString("HH:mm:ss") + "]: " + message.Text;
            chat = chat + mess + "\n";
            if ((Content as PreparePage) != null)
            {
                (Content as PreparePage).PostMessage(mess);
            }

            if ((Content as GamePage) != null)
            {
                (Content as GamePage).PostMessage(mess);
            }
        }