Exemple #1
0
 public void RoomCreated(battleship_common.Room room)
 {
     if (room.Name == _name)
     {
         waitPage = new WaitPage(this);
         ((RoomsPage)this.Content).grid.Children.Add(waitPage);
         waitPage.SetValue(Grid.RowSpanProperty, 4);
         waitPage.SetValue(Grid.ColumnSpanProperty, 2);
         return;
     }
     roomsPage.AddRoom(room);
 }
 public void AddRoom(Room room)
 {
     _rooms.Add(room);
 }
 public Room CreateRoom()
 {
     if (_room != null || _game != null)
     {
         return null;
     }
     _room = new Room(_name, DateTime.Now);
     _rooms.Add(_room);
     return _room;
 }
 public bool DeleteRoom()
 {
     if (_room == null)
     {
         return false;
     }
     _rooms.Remove(_room);
     _room = null;
     return true;
 }
        public Client(IClientCallback callback, string name)
        {
            this._callback = callback;
            this._name = name;
            this._GUID = Guid.NewGuid().ToString();

            callback.LogIn(this._GUID);
            foreach (var room in Client.Rooms)
            {
                callback.RoomCreated(room);
            }
            _room = null;
            _game = null;
            _ready = false;
        }