mindustry logic execution, map- and schematic- parsing and rendering
-rw-r--r--src/block/mod.rs30
-rw-r--r--src/main.rs2
2 files changed, 32 insertions, 0 deletions
diff --git a/src/block/mod.rs b/src/block/mod.rs
new file mode 100644
index 0000000..0c491ba
--- /dev/null
+++ b/src/block/mod.rs
@@ -0,0 +1,30 @@
+use std::borrow::Cow;
+
+pub trait BlockLogic
+{
+ fn get_size(&self) -> u8;
+}
+
+pub struct Block
+{
+ name: Cow<'static, str>,
+ logic: Box<dyn BlockLogic>,
+}
+
+impl Block
+{
+ pub fn new(name: Cow<'static, str>, logic: Box<dyn BlockLogic>) -> Self
+ {
+ Self{name, logic}
+ }
+
+ pub fn get_name(&self) -> &str
+ {
+ &self.name
+ }
+
+ pub fn get_size(&self) -> u8
+ {
+ self.logic.get_size()
+ }
+}
diff --git a/src/main.rs b/src/main.rs
index 6033e7c..f405f2d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,3 +1,5 @@
+pub mod block;
+
fn main()
{
}