Feat: a few bugs, but the event system works!
This commit is contained in:
1 parent
2041c88d07
commit
3b30fa61b8
13 files changed
+308
-117
No files matched your search
@@ -6,16 +6,29 @@
|
||||
//! The goal here is to provide a consistent event interface across all renderer types
|
||||
use generational_arena::Index;
|
||||
|
||||
use crate::innerlude::CbIdx;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct EventTrigger {
|
||||
pub component_id: Index,
|
||||
pub listener_id: u32,
|
||||
pub listener_id: usize,
|
||||
pub event: VirtualEvent,
|
||||
}
|
||||
|
||||
impl EventTrigger {
|
||||
pub fn new() -> Self {
|
||||
todo!()
|
||||
pub fn new(event: VirtualEvent, cb: CbIdx) -> Self {
|
||||
let CbIdx {
|
||||
gi_id,
|
||||
gi_gen,
|
||||
listener_idx,
|
||||
} = cb;
|
||||
|
||||
let component_id = Index::from_raw_parts(gi_id, gi_gen);
|
||||
Self {
|
||||
component_id,
|
||||
listener_id: listener_idx,
|
||||
event,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user