Skip to main content

samp_sdk/omp/generated/
gangzone.rs

1//! `IGangZone` — generated by `cargo xtask gen-omp` from `Server/Components/GangZones/gangzones.hpp`.
2//! Implemented by `GangZone` in the server's `GangZones`.
3//!
4//! Do not edit: change `xtask/omp-wrappers.toml` or the generator and
5//! regenerate. Slots are clang's layout of the header for each ABI, checked
6//! against the official binaries by `cargo xtask check-abi --generated`.
7
8#![allow(unused_imports)]
9
10use crate::omp::containers::{FlatSet, HybridString, Pair, Span};
11use crate::omp::types::{
12    Colour, GTAQuat, Hours, Microseconds, Milliseconds, Minutes, Seconds, StringView, TimePoint,
13    UID, Vector2, Vector3, Vector4, WorldTimePoint,
14};
15use crate::omp::vtable::{call_vtable_small_struct, opaque, slots, virtual_fns};
16use crate::omp::*;
17
18slots! {
19    /// `bool IBaseGangZone::isShownForPlayer(const IPlayer &)`
20    SLOT_IS_SHOWN_FOR_PLAYER: usize = 6, 5;
21    /// `bool IBaseGangZone::isFlashingForPlayer(const IPlayer &)`
22    SLOT_IS_FLASHING_FOR_PLAYER: usize = 7, 6;
23    /// `void IBaseGangZone::showForPlayer(IPlayer &, const Colour &)`
24    SLOT_SHOW_FOR_PLAYER: usize = 8, 7;
25    /// `void IBaseGangZone::hideForPlayer(IPlayer &)`
26    SLOT_HIDE_FOR_PLAYER: usize = 9, 8;
27    /// `void IBaseGangZone::flashForPlayer(IPlayer &, const Colour &)`
28    SLOT_FLASH_FOR_PLAYER: usize = 10, 9;
29    /// `void IBaseGangZone::stopFlashForPlayer(IPlayer &)`
30    SLOT_STOP_FLASH_FOR_PLAYER: usize = 11, 10;
31    /// `GangZonePos IBaseGangZone::getPosition()`
32    SLOT_GET_POSITION: usize = 12, 11;
33    /// `void IBaseGangZone::setPosition(const GangZonePos &)`
34    SLOT_SET_POSITION: usize = 13, 12;
35    /// `bool IBaseGangZone::isPlayerInside(const IPlayer &)`
36    SLOT_IS_PLAYER_INSIDE: usize = 14, 13;
37    /// `const FlatHashSet<IPlayer *> & IBaseGangZone::getShownFor()`
38    SLOT_GET_SHOWN_FOR: usize = 15, 14;
39    /// `const Colour IBaseGangZone::getFlashingColourForPlayer(IPlayer &)`
40    SLOT_GET_FLASHING_COLOUR_FOR_PLAYER: usize = 16, 15;
41    /// `const Colour IBaseGangZone::getColourForPlayer(IPlayer &)`
42    SLOT_GET_COLOUR_FOR_PLAYER: usize = 17, 16;
43    /// `void IBaseGangZone::setLegacyPlayer(IPlayer *)`
44    SLOT_SET_LEGACY_PLAYER: usize = 18, 17;
45    /// `IPlayer * IBaseGangZone::getLegacyPlayer()`
46    SLOT_GET_LEGACY_PLAYER: usize = 19, 18;
47}
48
49virtual_fns! {
50    /// `bool IBaseGangZone::isShownForPlayer(const IPlayer &)`.
51    ///
52    /// # Safety
53    /// `gangzone` must be a live `IGangZone`.
54    #[must_use]
55    pub fn gangzone_is_shown_for_player(
56        gangzone: IGangZone,
57        player: *mut IPlayer,
58    ) -> bool = [0, SLOT_IS_SHOWN_FOR_PLAYER] or false;
59
60    /// `bool IBaseGangZone::isFlashingForPlayer(const IPlayer &)`.
61    ///
62    /// # Safety
63    /// `gangzone` must be a live `IGangZone`.
64    #[must_use]
65    pub fn gangzone_is_flashing_for_player(
66        gangzone: IGangZone,
67        player: *mut IPlayer,
68    ) -> bool = [0, SLOT_IS_FLASHING_FOR_PLAYER] or false;
69
70    /// `void IBaseGangZone::showForPlayer(IPlayer &, const Colour &)`.
71    ///
72    /// # Safety
73    /// `gangzone` must be a live `IGangZone`.
74    pub fn gangzone_show_for_player(
75        gangzone: IGangZone,
76        player: *mut IPlayer,
77        colour: &Colour,
78    ) = [0, SLOT_SHOW_FOR_PLAYER];
79
80    /// `void IBaseGangZone::hideForPlayer(IPlayer &)`.
81    ///
82    /// # Safety
83    /// `gangzone` must be a live `IGangZone`.
84    pub fn gangzone_hide_for_player(
85        gangzone: IGangZone,
86        player: *mut IPlayer,
87    ) = [0, SLOT_HIDE_FOR_PLAYER];
88
89    /// `void IBaseGangZone::flashForPlayer(IPlayer &, const Colour &)`.
90    ///
91    /// # Safety
92    /// `gangzone` must be a live `IGangZone`.
93    pub fn gangzone_flash_for_player(
94        gangzone: IGangZone,
95        player: *mut IPlayer,
96        colour: &Colour,
97    ) = [0, SLOT_FLASH_FOR_PLAYER];
98
99    /// `void IBaseGangZone::stopFlashForPlayer(IPlayer &)`.
100    ///
101    /// # Safety
102    /// `gangzone` must be a live `IGangZone`.
103    pub fn gangzone_stop_flash_for_player(
104        gangzone: IGangZone,
105        player: *mut IPlayer,
106    ) = [0, SLOT_STOP_FLASH_FOR_PLAYER];
107
108    /// `GangZonePos IBaseGangZone::getPosition()`.
109    ///
110    /// # Safety
111    /// `gangzone` must be a live `IGangZone`.
112    #[must_use]
113    pub fn gangzone_position(
114        gangzone: IGangZone,
115    ) -> GangZonePos = [0, SLOT_GET_POSITION] or GangZonePos::default();
116
117    /// `void IBaseGangZone::setPosition(const GangZonePos &)`.
118    ///
119    /// # Safety
120    /// `gangzone` must be a live `IGangZone`.
121    pub fn gangzone_set_position(
122        gangzone: IGangZone,
123        position: &GangZonePos,
124    ) = [0, SLOT_SET_POSITION];
125
126    /// `bool IBaseGangZone::isPlayerInside(const IPlayer &)`.
127    ///
128    /// # Safety
129    /// `gangzone` must be a live `IGangZone`.
130    #[must_use]
131    pub fn gangzone_is_player_inside(
132        gangzone: IGangZone,
133        player: *mut IPlayer,
134    ) -> bool = [0, SLOT_IS_PLAYER_INSIDE] or false;
135
136    /// `const FlatHashSet<IPlayer *> & IBaseGangZone::getShownFor()`.
137    ///
138    /// # Safety
139    /// `gangzone` must be a live `IGangZone`.
140    #[must_use]
141    pub fn gangzone_shown_for(
142        gangzone: IGangZone,
143    ) -> *const FlatSet<IPlayer> = [0, SLOT_GET_SHOWN_FOR] or std::ptr::null();
144
145    /// `void IBaseGangZone::setLegacyPlayer(IPlayer *)`.
146    ///
147    /// # Safety
148    /// `gangzone` must be a live `IGangZone`.
149    pub fn gangzone_set_legacy_player(
150        gangzone: IGangZone,
151        player: *mut IPlayer,
152    ) = [0, SLOT_SET_LEGACY_PLAYER];
153
154    /// `IPlayer * IBaseGangZone::getLegacyPlayer()`.
155    ///
156    /// # Safety
157    /// `gangzone` must be a live `IGangZone`.
158    #[must_use]
159    pub fn gangzone_legacy_player(
160        gangzone: IGangZone,
161    ) -> *mut IPlayer = [0, SLOT_GET_LEGACY_PLAYER] or std::ptr::null_mut();
162}
163
164/// `const Colour IBaseGangZone::getFlashingColourForPlayer(IPlayer &)`.
165///
166/// # Safety
167/// `gangzone` must be a live `IGangZone`.
168#[must_use]
169pub unsafe fn gangzone_flashing_colour_for_player(
170    gangzone: *mut IGangZone,
171    player: *mut IPlayer,
172) -> Option<Colour> {
173    call_vtable_small_struct!(gangzone.cast::<u8>(), 0, SLOT_GET_FLASHING_COLOUR_FOR_PLAYER, Colour, Colour::default(), (*mut IPlayer) (player))
174}
175
176/// `const Colour IBaseGangZone::getColourForPlayer(IPlayer &)`.
177///
178/// # Safety
179/// `gangzone` must be a live `IGangZone`.
180#[must_use]
181pub unsafe fn gangzone_colour_for_player(
182    gangzone: *mut IGangZone,
183    player: *mut IPlayer,
184) -> Option<Colour> {
185    call_vtable_small_struct!(gangzone.cast::<u8>(), 0, SLOT_GET_COLOUR_FOR_PLAYER, Colour, Colour::default(), (*mut IPlayer) (player))
186}