private void Init() { // Start the game by going to the first room if (Rooms.Any()) { SetCurrentRoom(Rooms[RoomOrder.First()], true); } }
private void NextCommandExecute() { IsRoomSelected = Rooms != null && Rooms.Any(); IsStayTypeSelected = StayTypes != null && StayTypes.Any(); IsPeopleNumberValid = PeopleNumber > 0; IsDetailsVisible = IsStayTypeSelected && IsRoomSelected && IsPeopleNumberValid; }
private void DeleteInvalidRooms() { foreach (var i in _items) { if (!Rooms.Any(x => x.RoomID == i.RoomID)) { i.Deleted = true; } } }
public override void Initialize() { //if (!( Rooms ?? throw new ArgumentNullException(nameof(Rooms), "No Rooms Config Found") ).Any(r => r.Debug)) return; LogInformation($"Initialise (DEBUG) "); var lightsManagerConfigs = Rooms.Any(r => r.Debug) ? Rooms.Where(r => r.Debug).ToList() : Rooms.ToList(); foreach (var lightsManagerConfig in lightsManagerConfigs) { var configurator = new Configurator(lightsManagerConfig); configurator.Configure(this); var manager = new Manager(this, configurator); } }
private void ClientRoomOpened(RoomOpenedEventArgs e) { // If room view model already exist then event will be processed by it self if (Rooms.Any(vm => vm.Name == e.RoomName)) { return; } // Else create new view model var roomViewModel = new RoomViewModel(this, e.RoomName); roomViewModel.Updated = true; Rooms.Add(roomViewModel); _window.Alert(); }
public void AddPatient(Patient patient) { if (!Rooms.Any()) { Rooms.Add(Rooms.Count + 1, new Room()); } if (Patients.Count < 60) { if (Rooms[Rooms.Count].BedsBisy.Count == 3 && Rooms.Count < 20) { Rooms.Add(Rooms.Count + 1, new Room()); } Rooms[Rooms.Count].BedsBisy.Add(patient.Name); Patients.Add(patient.Name); } }
private void CreateNewReservationDialogViewModel_OnDateChanged() { if (Rooms != null) { if (Rooms.Any()) { Rooms.Clear(); } } var rooms = _roomService.LoadAvailableRooms(StartDate, EndDate, PeopleNumber); if (rooms != null) { Rooms = new ObservableCollection <AvailableRoomRequest>(rooms); } if (rooms is null) { MessageBox.Show("Nema slobodnih soba za izabrani period", "Obavestenje"); } }
public async Task <RoomRegistry> CreateRoomAsync(string username, string roomName, string password, bool isPubliclyVisible, params string[] modorators) { if (Rooms.Any(room => room.RoomName.Equals(roomName, StringComparison.Ordinal))) { return(null); } var createdRoom = new RoomRegistry { RoomName = roomName, RoomKey = Guid.NewGuid(), RoomPassword = password, IsPubliclyVisible = isPubliclyVisible, Modorators = new [] { username }.ToList(), CreatedAt = DateTime.UtcNow, CreatedBy = username }; Rooms.Add(createdRoom); await GrainFactory.GetGrain <IRoomGrain>(roomName).SetupRoomAsync(createdRoom); return(createdRoom); }
/// <summary> /// Returns true if a cell location is inside any room on the map. /// </summary> /// <param name="row">The desired row.</param> /// <param name="column">The desired column.</param> /// <returns>True if the specified location is in any room on the map.</returns> public bool IsLocationInRoom(int row, int column) { return(Rooms.Any(room => room.IsLocationInRoom(row, column))); }
private static bool IsRoomExist(Room room) { return(Rooms.Any(r => r.Name.Equals(room.Name))); }
public bool IsUserInGame(string userId) { return(Rooms.Any(x => x.PlayerOne == userId || x.PlayerTwo == userId)); }