Skip to content

Commit db7fcb2

Browse files
committed
Minor cleanup
1 parent 79da67d commit db7fcb2

6 files changed

Lines changed: 38 additions & 37 deletions

File tree

Cargo.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codegen/main.rs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl PythonBindType {
6363
"PlayerClass",
6464
"GameMessage",
6565
"CollisionShape",
66-
"RelativeAnchor",
66+
"RelativeRAnchor",
6767
"RenderType",
6868
];
6969

@@ -82,6 +82,7 @@ impl PythonBindType {
8282
struct_name.push_str(&c[1..]);
8383
}
8484
struct_name = struct_name
85+
.replace("Ranchor", "RAnchor")
8586
.replace("Rlbot", "RLBot")
8687
.replace("Halign", "HAlign")
8788
.replace("Valign", "VAlign");
@@ -180,20 +181,23 @@ fn run_flatc() -> io::Result<()> {
180181

181182
let schema_folder_str = schema_folder.display();
182183

183-
Command::new(format!("{schema_folder_str}/{FLATC_BINARY}"))
184-
.args([
185-
"--rust",
186-
"--gen-object-api",
187-
"--gen-all",
188-
"--filename-suffix",
189-
"",
190-
"--rust-module-root-file",
191-
"-o",
192-
OUT_FOLDER,
193-
&format!("{schema_folder_str}/rlbot.fbs"),
194-
])
195-
.spawn()?
196-
.wait()?;
184+
let mut proc = Command::new(format!("{schema_folder_str}/{FLATC_BINARY}"));
185+
186+
proc.args([
187+
"--rust",
188+
"--gen-object-api",
189+
"--gen-all",
190+
"--filename-suffix",
191+
"",
192+
"--rust-module-root-file",
193+
"-o",
194+
OUT_FOLDER,
195+
&format!("{schema_folder_str}/rlbot.fbs"),
196+
])
197+
.spawn()?
198+
.wait()?;
199+
200+
assert!(proc.status()?.success(), "flatc failed to run");
197201

198202
Ok(())
199203
}

codegen/pyi.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,7 @@ pub fn generator(type_data: &[PythonBindType]) -> io::Result<()> {
8484
);
8585
write_str!(file, " \"\"\"\n");
8686
write_str!(file, " def __int__(self) -> int: ...");
87-
write_fmt!(
88-
file,
89-
" def __eq__(self, other: {type_name}) -> bool: ..."
90-
);
87+
write_fmt!(file, " def __eq__(self, other: {type_name}) -> bool: ...");
9188
write_str!(file, " def __hash__(self) -> str: ...");
9289
}
9390
PythonBindType::Struct(gen) => {

codegen/unions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl UnionBindGenerator {
102102
self.struct_name
103103
);
104104
} else {
105-
write_str!(self, " None => String::from(\"None\"),");
105+
write_str!(self, " None => crate::none_str(),");
106106
}
107107
}
108108

pytest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ def random_script_config():
6464

6565
render_type = RenderMessage(
6666
Line3D(
67-
Anchor(Vector3(0, 0, 0)),
68-
Anchor(relative=CarAnchor(0, MyVector(1, 1, 1))),
67+
RAnchor(),
68+
RAnchor(relative=CarRAnchor(0, MyVector(1, 1, 1))),
6969
Color(255),
7070
)
7171
)

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,11 @@ pynamedmodule! {
165165
name: rlbot_flatbuffers,
166166
classes: [
167167
AirState,
168-
Anchor,
169-
BallAnchor,
170168
BallBouncinessOption,
171169
BallInfo,
172170
BallMaxSpeedOption,
173171
BallPrediction,
172+
BallRAnchor,
174173
BallSizeOption,
175174
BallTypeOption,
176175
BallWeightOption,
@@ -180,7 +179,7 @@ pynamedmodule! {
180179
BoostPadState,
181180
BoostStrengthOption,
182181
BoxShape,
183-
CarAnchor,
182+
CarRAnchor,
184183
CollisionShape,
185184
Color,
186185
ConsoleCommand,
@@ -229,9 +228,10 @@ pynamedmodule! {
229228
PolyLine3D,
230229
PredictionSlice,
231230
Psyonix,
231+
RAnchor,
232232
RLBot,
233233
ReadyMessage,
234-
RelativeAnchor,
234+
RelativeRAnchor,
235235
RemoveRenderGroup,
236236
RenderGroup,
237237
RenderMessage,

0 commit comments

Comments
 (0)