mindustry logic execution, map- and schematic- parsing and rendering
Diffstat (limited to 'src/block/production.rs')
| -rw-r--r-- | src/block/production.rs | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/src/block/production.rs b/src/block/production.rs index 9cb13ca..cd48482 100644 --- a/src/block/production.rs +++ b/src/block/production.rs @@ -52,20 +52,22 @@ make_simple!( // electrolyzer exclusive // ozone <- e(^) -> hydrogen let mut base = load!("electrolyzer", s); - base.overlay(unsafe { - load!(s -> match r { - Rotation::Up | Rotation::Left => "electrolyzer-hydrogen-output1" - Rotation::Down | Rotation::Right => "electrolyzer-hydrogen-output2" - }) - .rotate(r.count()) - }); - base.overlay(unsafe { - load!(s -> match r { - Rotation::Down | Rotation::Right => "electrolyzer-ozone-output1" - Rotation::Up | Rotation::Left => "electrolyzer-ozone-output2" - }) - .rotate(r.mirrored(true, true).count()) - }); + unsafe { + base.overlay( + load!(s -> match r { + Rotation::Up | Rotation::Left => "electrolyzer-hydrogen-output1" + Rotation::Down | Rotation::Right => "electrolyzer-hydrogen-output2" + }) + .rotate(r.count()), + ); + base.overlay( + load!(s -> match r { + Rotation::Down | Rotation::Right => "electrolyzer-ozone-output1" + Rotation::Up | Rotation::Left => "electrolyzer-ozone-output2" + }) + .rotate(r.mirrored(true, true).count()), + ); + } base }, |b: &mut Build<'_>, _, _, buff: &mut DataRead| { @@ -82,10 +84,12 @@ make_simple!( HeatCrafter, |_, n, _, _, r: Rotation, s| { let mut base = load!(from n which is ["phase-heater" | "electric-heater" | "oxidation-chamber" | "slag-heater" | "heat-source"], s); - base.overlay(unsafe { match r { + unsafe { + base.overlay(match r { Rotation::Up | Rotation::Right => load!(concat "top1" => n which is ["phase-heater" | "electric-heater" | "oxidation-chamber" | "slag-heater" | "heat-source"], s), Rotation::Down | Rotation::Left => load!(concat "top2" => n which is ["phase-heater" | "electric-heater" | "oxidation-chamber" | "slag-heater" | "heat-source"], s) - }.rotate(r.rotated(false).count())}); + }.rotate(r.rotated(false).count())) + }; base }, |_, _, _, buff: &mut DataRead| { @@ -99,16 +103,18 @@ make_simple!( ); make_simple!(HeatConduit, |_, n, _, _, r: Rotation, s| { let mut base = load!(from n which is ["heat-router" | "heat-redirector"], s); - base.overlay(unsafe { - match r { - Rotation::Up | Rotation::Right => { - load!(concat "top1" => n which is ["heat-router" | "heat-redirector"], s) - } - Rotation::Down | Rotation::Left => { - load!(concat "top2" => n which is ["heat-router" | "heat-redirector"], s) + unsafe { + base.overlay( + match r { + Rotation::Up | Rotation::Right => { + load!(concat "top1" => n which is ["heat-router" | "heat-redirector"], s) + } + Rotation::Down | Rotation::Left => { + load!(concat "top2" => n which is ["heat-router" | "heat-redirector"], s) + } } - } - .rotate(r.rotated(false).count()) - }); + .rotate(r.rotated(false).count()), + ) + }; base }); |