rust/lib-hedgewars-engine/src/lib.rs
changeset 14875 aed75d439027
parent 14734 cc6ab1e3f7d5
child 15286 07e909ba4203
--- a/rust/lib-hedgewars-engine/src/lib.rs	Mon Apr 29 23:13:52 2019 +0200
+++ b/rust/lib-hedgewars-engine/src/lib.rs	Mon Apr 29 23:41:25 2019 +0200
@@ -23,6 +23,64 @@
     land: *const u8,
 }
 
+#[repr(C)]
+#[derive(Debug, PartialEq, Clone)]
+pub enum SimpleEventType {
+    SwitchHedgehog,
+    Timer,
+    LongJump,
+    HighJump,
+    Accept,
+    Deny,
+}
+
+#[repr(C)]
+#[derive(Debug, PartialEq, Clone)]
+pub enum LongEventType {
+    ArrowUp,
+    ArrowDown,
+    ArrowLeft,
+    ArrowRight,
+    Precision,
+    Attack,
+}
+
+#[repr(C)]
+#[derive(Debug, PartialEq, Clone)]
+pub enum LongEventState {
+    Set,
+    Unset,
+}
+
+#[repr(C)]
+#[derive(Debug, PartialEq, Clone)]
+pub enum PositionedEventType {
+    CursorMove,
+    CursorClick,
+}
+
+#[no_mangle]
+pub extern "C" fn simple_event(engine_state: &mut EngineInstance, event_type: SimpleEventType) {}
+
+#[no_mangle]
+pub extern "C" fn long_event(
+    engine_state: &mut EngineInstance,
+    event_type: LongEventType,
+    state: LongEventState,
+) {
+    println!("{:?}: {:?}", event_type, state);
+}
+
+#[no_mangle]
+pub extern "C" fn positioned_event(
+    engine_state: &mut EngineInstance,
+    event_type: PositionedEventType,
+    x: i32,
+    y: i32,
+) {
+
+}
+
 #[no_mangle]
 pub extern "C" fn hedgewars_engine_protocol_version() -> u32 {
     58