equal
deleted
inserted
replaced
521 |
521 |
522 pub struct HwRoomControl<'a> { |
522 pub struct HwRoomControl<'a> { |
523 server: &'a mut HwServer, |
523 server: &'a mut HwServer, |
524 client_id: ClientId, |
524 client_id: ClientId, |
525 room_id: RoomId, |
525 room_id: RoomId, |
526 is_room_removed: bool |
526 is_room_removed: bool, |
527 } |
527 } |
528 |
528 |
529 impl<'a> HwRoomControl<'a> { |
529 impl<'a> HwRoomControl<'a> { |
530 #[inline] |
530 #[inline] |
531 pub fn new(server: &'a mut HwServer, client_id: ClientId) -> Option<Self> { |
531 pub fn new(server: &'a mut HwServer, client_id: ClientId) -> Option<Self> { |
532 if let Some(room_id) = server.clients[client_id].room_id { |
532 if let Some(room_id) = server.clients[client_id].room_id { |
533 Some(Self { |
533 Some(Self { |
534 server, |
534 server, |
535 client_id, |
535 client_id, |
536 room_id, |
536 room_id, |
537 is_room_removed: false |
537 is_room_removed: false, |
538 }) |
538 }) |
539 } else { |
539 } else { |
540 None |
540 None |
541 } |
541 } |
542 } |
542 } |