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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! The points of the Safes mod (`safes`).
use crateEntity;
/// What a player tries to do with a Safe.
///
/// # Examples
///
/// ```
/// use enshwick::points::safes::SafeAction;
///
/// assert_ne!(SafeAction::USE, SafeAction::REMOVE);
/// ```
;
/// Who may open, use, remove or manage a Safe, `safes:access`: the answer
/// is whether the player may, and a refusal is final.
///
/// The Safes mod answers first: the owner may do all, the players they
/// allowed only use it, administrators all when its settings allow. A
/// player the server has not registered yet is refused before the point is
/// asked. Asked on the server's worker threads, inside the game's systems:
/// a link reads lock-free state only.
///
/// # Examples
///
/// ```
/// use enshwick::points::safes::{Access, SafeAction};
/// use enshwick::points::{Order, Verdict};
///
/// fn init(load: &mut enshwick::Load<'_>) -> Result<(), enshwick::Off> {
/// // Nobody but the owner removes a Safe, administrators included.
/// load.extend_point(&Order::new(), |access: &Access, _may: &bool| {
/// if access.action == SafeAction::REMOVE && access.player != access.owner {
/// Verdict::Refuse
/// } else {
/// Verdict::Pass
/// }
/// })
/// }
/// ```