added domains into crates
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
use prometeu_hal::{InputSignals, TouchBridge};
|
||||
use prometeu_hal::button::Button;
|
||||
|
||||
#[derive(Default, Clone, Copy, Debug)]
|
||||
pub struct Touch {
|
||||
pub f: Button,
|
||||
pub x: i32,
|
||||
pub y: i32,
|
||||
}
|
||||
|
||||
impl Touch {
|
||||
/// Transient flags should last only 1 frame.
|
||||
pub fn begin_frame(&mut self, signals: &InputSignals) {
|
||||
self.f.begin_frame(signals.f_signal);
|
||||
self.x = signals.x_pos.clone();
|
||||
self.y = signals.y_pos.clone();
|
||||
}
|
||||
}
|
||||
|
||||
impl TouchBridge for Touch {
|
||||
fn begin_frame(&mut self, signals: &InputSignals) { self.begin_frame(signals) }
|
||||
fn f(&self) -> &Button { &self.f }
|
||||
fn x(&self) -> i32 { self.x }
|
||||
fn y(&self) -> i32 { self.y }
|
||||
}
|
||||
Reference in New Issue
Block a user