Debian Codegraph @

src/game_config.rs

raw symbols SCIP
1 /*
2 * Copyright 2020-2026 Andrey Kutejko <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 *
17 * For more details see the file COPYING.
18 */
19
20 use gettextrsrust-analyzer cargo gettext-rs 0.7.7 crate/::gettextrust-analyzer cargo gettext-rs 0.7.7 gettext().;
21 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::numrust-analyzer cargo std https://github.com/rust-lang/rust/library/std num/::NonZeroU32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/NonZeroU32#;
22 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/::Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#;
23
24 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)]
25 pub struct GameConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig# {
26 pub namerust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#name.: &'static str,
27 pub display_namerust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#display_name.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
28 pub robot_type1rust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#robot_type1.: RobotTypeConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#,
29 pub robot_type2rust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#robot_type2.: RobotTypeConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#,
30 pub safe_teleportsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#safe_teleports.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<SafeTeleportsConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#>,
31 pub moveable_heapsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#moveable_heaps.: bool,
32 }
33
34 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)]
35 pub struct RobotTypeConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig# {
36 pub initialrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#initial.: u32,
37 pub incrementrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#increment.: u32,
38 pub maximumrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#maximum.: u32,
39 pub scorerust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score.: u32,
40 pub score_waitingrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score_waiting.: u32,
41 pub score_splattedrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score_splatted.: u32,
42 }
43
44 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)]
45 pub struct SafeTeleportsConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig# {
46 pub initialrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#initial.: u32,
47 pub freerust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#free.: u32,
48 pub maxrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#max.: u32,
49 pub kill_reward_pricerust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#kill_reward_price.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<NonZeroU32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/NonZeroU32#>,
50 }
51
52 pub struct Rewardrust-analyzer cargo gnome-robots 50.0.0 game_config/Reward# {
53 pub pricerust-analyzer cargo gnome-robots 50.0.0 game_config/Reward#price.: u32,
54 pub safe_teleports_rewardrust-analyzer cargo gnome-robots 50.0.0 game_config/Reward#safe_teleports_reward.: u32,
55 }
56
57 impl RobotTypeConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig# {
58 pub fn robots_on_levelrust-analyzer cargo gnome-robots 50.0.0 game_config/impl#[RobotTypeConfig]robots_on_level().(&self, level: u32) -> u32 {
59 (self.initialrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#initial. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Add<Self>`]add().self.incrementrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#increment. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().level).clamprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][Ord]clamp().(0, self.maximumrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#maximum.)
60 }
61 }
62
63 impl SafeTeleportsConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig# {
64 pub fn freerust-analyzer cargo gnome-robots 50.0.0 game_config/impl#[SafeTeleportsConfig]free().(&self, current: u32) -> u32 {
65 u32::minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#min().(self.freerust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#free., self.maxrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#max..saturating_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]saturating_sub().(current))
66 }
67
68 pub fn kills_rewardrust-analyzer cargo gnome-robots 50.0.0 game_config/impl#[SafeTeleportsConfig]kills_reward().(&self, current: u32, kills: u32) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Rewardrust-analyzer cargo gnome-robots 50.0.0 game_config/Reward#> {
69 let kill_reward_price: u32 = self.kill_reward_pricerust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#kill_reward_price.?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][Try]branch()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().();
70 let safe_teleports_reward =
71 u32::minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#min().(kills rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Div<Self>`]div().kill_reward_price, self.maxrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#max..saturating_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]saturating_sub().(current));
72 (safe_teleports_reward rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().0).then_somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core bool/impl#[bool]then_some().({
73 Rewardrust-analyzer cargo gnome-robots 50.0.0 game_config/Reward# {
74 pricerust-analyzer cargo gnome-robots 50.0.0 game_config/Reward#price.: safe_teleports_reward rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Mul<Self>`]mul().kill_reward_price,
75 safe_teleports_rewardrust-analyzer cargo gnome-robots 50.0.0 game_config/Reward#safe_teleports_reward.,
76 }
77 })
78 }
79 }
80
81 fn classic_robotsrust-analyzer cargo gnome-robots 50.0.0 game_config/classic_robots().() -> GameConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig# {
82 GameConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig# {
83 namerust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#name.: "classic_robots",
84 display_namerust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#display_name.: gettextrust-analyzer cargo gettext-rs 0.7.7 gettext().("Classic robots"),
85 robot_type1rust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#robot_type1.: RobotTypeConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig# {
86 initialrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#initial.: 10,
87 incrementrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#increment.: 10,
88 maximumrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#maximum.: 9999,
89 scorerust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score.: 10,
90 score_waitingrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score_waiting.: 10,
91 score_splattedrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score_splatted.: 10,
92 },
93 robot_type2rust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#robot_type2.: RobotTypeConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig# {
94 initialrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#initial.: 0,
95 incrementrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#increment.: 0,
96 maximumrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#maximum.: 0,
97 scorerust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score.: 0,
98 score_waitingrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score_waiting.: 0,
99 score_splattedrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score_splatted.: 0,
100 },
101 safe_teleportsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#safe_teleports.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
102 moveable_heapsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#moveable_heaps.: false,
103 }
104 }
105
106 fn robots_with_safe_teleportrust-analyzer cargo gnome-robots 50.0.0 game_config/robots_with_safe_teleport().() -> GameConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig# {
107 GameConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig# {
108 namerust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#name.: "robots_with_safe_teleport",
109 display_namerust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#display_name.: gettextrust-analyzer cargo gettext-rs 0.7.7 gettext().("Robots with safe teleport"),
110 safe_teleportsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#safe_teleports.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(SafeTeleportsConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig# {
111 initialrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#initial.: 0,
112 freerust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#free.: 0,
113 maxrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#max.: 10,
114 kill_reward_pricerust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#kill_reward_price.: NonZeroU32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/NonZeroU32#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[`NonZero<T>`]new().(1),
115 }),
116 ..classic_robotsrust-analyzer cargo gnome-robots 50.0.0 game_config/classic_robots().()
117 }
118 }
119
120 fn robots2rust-analyzer cargo gnome-robots 50.0.0 game_config/robots2().() -> GameConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig# {
121 GameConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig# {
122 namerust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#name.: "robots2",
123 display_namerust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#display_name.: gettextrust-analyzer cargo gettext-rs 0.7.7 gettext().("Robots2"),
124 robot_type1rust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#robot_type1.: RobotTypeConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig# {
125 initialrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#initial.: 8,
126 incrementrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#increment.: 8,
127 maximumrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#maximum.: 9999,
128 scorerust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score.: 10,
129 score_waitingrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score_waiting.: 10,
130 score_splattedrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score_splatted.: 20,
131 },
132 robot_type2rust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#robot_type2.: RobotTypeConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig# {
133 initialrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#initial.: 2,
134 incrementrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#increment.: 2,
135 maximumrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#maximum.: 9999,
136 scorerust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score.: 20,
137 score_waitingrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score_waiting.: 20,
138 score_splattedrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score_splatted.: 40,
139 },
140 safe_teleportsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#safe_teleports.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(SafeTeleportsConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig# {
141 initialrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#initial.: 1,
142 freerust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#free.: 0,
143 maxrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#max.: 10,
144 kill_reward_pricerust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#kill_reward_price.: NonZeroU32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/NonZeroU32#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[`NonZero<T>`]new().(1),
145 }),
146 moveable_heapsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#moveable_heaps.: true,
147 }
148 }
149
150 fn robots2_easyrust-analyzer cargo gnome-robots 50.0.0 game_config/robots2_easy().() -> GameConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig# {
151 let robots2 = robots2rust-analyzer cargo gnome-robots 50.0.0 game_config/robots2().();
152 GameConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig# {
153 namerust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#name.: "robots2_easy",
154 display_namerust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#display_name.: gettextrust-analyzer cargo gettext-rs 0.7.7 gettext().("Robots2 easy"),
155 safe_teleportsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#safe_teleports.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(SafeTeleportsConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig# {
156 initialrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#initial.: 2,
157 freerust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#free.: 1,
158 ..robots2.safe_teleportsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#safe_teleports..unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()
159 }),
160 ..robots2
161 }
162 }
163
164 fn nightmarerust-analyzer cargo gnome-robots 50.0.0 game_config/nightmare().() -> GameConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig# {
165 GameConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig# {
166 namerust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#name.: "nightmare",
167 display_namerust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#display_name.: gettextrust-analyzer cargo gettext-rs 0.7.7 gettext().("Nightmare"),
168 robot_type1rust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#robot_type1.: RobotTypeConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig# {
169 initialrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#initial.: 2,
170 incrementrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#increment.: 2,
171 maximumrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#maximum.: 9999,
172 scorerust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score.: 10,
173 score_waitingrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score_waiting.: 10,
174 score_splattedrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score_splatted.: 20,
175 },
176 robot_type2rust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#robot_type2.: RobotTypeConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig# {
177 initialrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#initial.: 8,
178 incrementrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#increment.: 8,
179 maximumrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#maximum.: 9999,
180 scorerust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score.: 20,
181 score_waitingrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score_waiting.: 20,
182 score_splattedrust-analyzer cargo gnome-robots 50.0.0 game_config/RobotTypeConfig#score_splatted.: 40,
183 },
184 safe_teleportsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#safe_teleports.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(SafeTeleportsConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig# {
185 initialrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#initial.: 1,
186 freerust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#free.: 1,
187 maxrust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#max.: 10,
188 kill_reward_pricerust-analyzer cargo gnome-robots 50.0.0 game_config/SafeTeleportsConfig#kill_reward_price.: NonZeroU32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/NonZeroU32#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[`NonZero<T>`]new().(2),
189 }),
190 moveable_heapsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#moveable_heaps.: true,
191 }
192 }
193
194 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)]
195 pub struct GameConfigsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfigs# {
196 pub game_configsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfigs#game_configs.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<GameConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#>>,
197 }
198
199 impl GameConfigsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfigs# {
200 pub fn newrust-analyzer cargo gnome-robots 50.0.0 game_config/impl#[GameConfigs]new().() -> Selfrust-analyzer cargo gnome-robots 50.0.0 game_config/impl#[GameConfigs] {
201 Selfrust-analyzer cargo gnome-robots 50.0.0 game_config/impl#[GameConfigs] {
202 game_configsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfigs#game_configs.: vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![
203 Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/impl#[`Rc<T>`]new().(classic_robotsrust-analyzer cargo gnome-robots 50.0.0 game_config/classic_robots().()),
204 Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/impl#[`Rc<T>`]new().(robots_with_safe_teleportrust-analyzer cargo gnome-robots 50.0.0 game_config/robots_with_safe_teleport().()),
205 Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/impl#[`Rc<T>`]new().(robots2rust-analyzer cargo gnome-robots 50.0.0 game_config/robots2().()),
206 Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/impl#[`Rc<T>`]new().(robots2_easyrust-analyzer cargo gnome-robots 50.0.0 game_config/robots2_easy().()),
207 Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/impl#[`Rc<T>`]new().(nightmarerust-analyzer cargo gnome-robots 50.0.0 game_config/nightmare().()),
208 ],
209 }
210 }
211
212 pub fn find_by_namerust-analyzer cargo gnome-robots 50.0.0 game_config/impl#[GameConfigs]find_by_name().(&self, name: &str) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<GameConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#>> {
213 self.game_configsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfigs#game_configs.
214 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
215 .findrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/iter/impl#[`Iter<'a, T>`][Iterator]find().(|gc| gc.namerust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#name. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().name || gc.namerust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#name..replacerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]replace().('_', " ") rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`PartialEq<&str>`]eq().==rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`PartialEq<&str>`]eq(). rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`PartialEq<&str>`]eq().name)
216 }
217
218 pub fn best_matchrust-analyzer cargo gnome-robots 50.0.0 game_config/impl#[GameConfigs]best_match().(&self, name: &str) -> &Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<GameConfigrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfig#> {
219 self.find_by_namerust-analyzer cargo gnome-robots 50.0.0 game_config/impl#[GameConfigs]find_by_name().(name)
220 .unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(|| &self.game_configsrust-analyzer cargo gnome-robots 50.0.0 game_config/GameConfigs#game_configs.[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().0]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().)
221 }
222 }