1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Which rooms a connection can actually play in, and in what order to offer
//! them.
//!
//! A free function over metadata rather than a method on the manager, because
//! the rule is useful without a manager. A game whose rooms are a fixed table
//! decided at startup should not have to implement a `RoomFactory` to ask this
//! question, and the manager's own
//! [`rooms_playable_at`](crate::manager::InMemoryLobbyManager::rooms_playable_at)
//! is this with its rooms filled in.
use Debug;
use crateRoomMetadata;
/// The rooms this connection could play in, best fit first.
///
/// **Ordered tightest-schedule-first**, so a fast connection is not sent to a
/// room built for slow ones and given a delay it does not need. A room that
/// states no limit sorts last: it will take anybody, so it is the fallback.
///
/// Full rooms are dropped too, since a player cannot enter them.
/// The single best room for this connection, or `None` when nothing fits.
///
/// Refuse a connection only when this returns `None`; any other result is a
/// placement. This decision belongs to a lobby because a room can only accept
/// or refuse, while this picks a room.