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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
//! Flame altars: their zones, sizes and the zone check.
use c_void;
use crate;
/// A box of whole cells or of 32.32 fixed-point metres, as its user says:
/// `min` inclusive, `max` exclusive on each axis; axis 1 is up.
///
/// # Examples
///
/// ```
/// use enshwick::abi::Bounds;
///
/// let zone = Bounds { min: [0, 0, 0], max: [80, 80, 80] };
/// assert_eq!(zone.max[0] - zone.min[0], 80);
/// ```
/// One Flame Altar of the server's world, from [`HostApi::altars`](super::HostApi::altars).
///
/// Zones are in whole 0.5 m cells, rounded outwards, as the engine builds
/// them from the altar's trigger shape.
///
/// # Examples
///
/// ```
/// use enshwick::abi::{AltarInfo, Bounds, Header};
///
/// let mut altar = AltarInfo::EMPTY;
/// altar.entity = enshwick::Entity(4096);
/// altar.level = 1;
/// altar.level_count = 1;
/// altar.zone = Bounds { min: [0, 0, 0], max: [80, 80, 80] };
/// altar.levels[0] = altar.zone;
/// assert_eq!(altar.header, Header::of::<AltarInfo>());
/// ```
impl_headed!;
/// One altar's zone as the loader sizes it, handed to every altar zone
/// filter in load order.
///
/// The zone is the altar's vanilla zone at `level` grown by `grow` cells on
/// every horizontal side and made `height` cells tall, as the filters before
/// have left it; see
/// [`HostApi::altar_zone_filter`](super::HostApi::altar_zone_filter).
///
/// # Examples
///
/// ```
/// use enshwick::abi::{AltarZone, Header};
///
/// let zone = AltarZone { header: Header::of::<AltarZone>(), altar: enshwick::Entity(4096), level: 2, reserved: [0; 3], grow: 0, height: 60 };
/// assert_eq!(zone.grow, 0);
/// ```
impl_headed!;
/// An altar zone filter: the zone so far, writable, and the pointer given
/// at registration. It must not unwind.
pub type AltarZoneFn = unsafe extern "system" fn;
/// A placement the game refused because the object's box does not lie in a
/// single building zone, as [`HostApi::building_zone_check_filter`](super::HostApi::building_zone_check_filter) hands it on.
/// Coordinates are 32.32 fixed-point metres.
///
/// The name is enshwick's, after the game's building zone: the game's check
/// has no name of its own.
///
/// # Examples
///
/// ```
/// use enshwick::abi::{Bounds, Header, BuildingZoneCheck};
///
/// let check = BuildingZoneCheck {
/// header: Header::of::<BuildingZoneCheck>(),
/// zones: core::ptr::null(),
/// zone_count: 0,
/// object: Bounds::default(),
/// margin: 0,
/// };
/// assert_eq!(check.zone_count, 0);
/// ```
impl_headed!;
/// A mod's zone check filter: the check and the pointer given at
/// registration; returns 1 to accept the placement after all.
pub type BuildingZoneCheckFn =
unsafe extern "system" fn ;