Пример #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);
 }
Пример #2
0
 public void AddRoom(Room room)
 {
     _rooms.Add(room);
 }
Пример #3
0
 public Room CreateRoom()
 {
     if (_room != null || _game != null)
     {
         return null;
     }
     _room = new Room(_name, DateTime.Now);
     _rooms.Add(_room);
     return _room;
 }
Пример #4
0
 public bool DeleteRoom()
 {
     if (_room == null)
     {
         return false;
     }
     _rooms.Remove(_room);
     _room = null;
     return true;
 }
Пример #5
0
        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;
        }