mindustry logic execution, map- and schematic- parsing and rendering
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
//! extraction of raw resources (mine part)
use crate::block::simple::make_simple;
use crate::block::*;

make_simple!(
    DrillBlock,
    |_, name, _, _, rot: Rotation, s| {
        let mut base =
            load!(from name which is ["large-plasma-bore" | "plasma-bore" | "cliff-crusher"], s);
        unsafe {
            base.overlay(load!(concat "top" => name which is ["large-plasma-bore" | "plasma-bore" | "cliff-crusher"], s).rotate(rot.rotated(false).count()) )
        };
        base
    },
    |_, buff: &mut DataRead| read_drill(buff)
);
make_simple!(WallDrillBlock, |_, _, _, _, rot: Rotation, scl| {
    let mut base = load!("cliff-crusher", scl);
    unsafe { base.overlay(load!("cliff-crusher-top", scl).rotate(rot.rotated(false).count())) };
    base
});

/// format:
/// - progress: [`f32`]
/// - warmup: [`f32`]
fn read_drill(buff: &mut DataRead) -> Result<(), DataReadError> {
    buff.skip(8)
}