This commit is contained in:
LunarAkai 2025-08-03 01:07:52 +02:00
commit bbd2a6089c
10 changed files with 62 additions and 16 deletions

View file

@ -4,4 +4,4 @@ edition = "2024"
version.workspace = true
authors.workspace = true
[dependencies]
[dependencies]

View file

@ -9,4 +9,8 @@ pub enum EventType {
pub trait Event {
fn get_event_name() -> &'static str;
fn get_event_type() -> EventType;
}
/// Emits the Event
fn emit();
}

View file

@ -1,5 +1,6 @@
use crate::{event::Event,};
use crate::{event::{Event, EventType}, events::key_events::KeyEvent};
#[derive(Debug)]
struct KeyPressedEvent{}
const KEY_PRESSED_EVENT_NAME: &str = "KeyPressedEvent";
@ -9,8 +10,12 @@ impl Event for KeyPressedEvent {
KEY_PRESSED_EVENT_NAME
}
fn get_event_type() -> crate::event::EventType {
crate::event::EventType::KeyPressed
fn get_event_type() -> EventType {
EventType::KeyPressed
}
fn emit(&self) -> &impl Event{
self
}
}

View file

@ -1,3 +1,5 @@
pub mod window_close_event;
use crate::event::Event;
pub trait WindowEvent: Event {

View file

@ -0,0 +1,23 @@
use crate::{event::Event, events::window_events::WindowEvent};
#[derive(Debug)]
pub struct WindowCloseEvent {
}
impl Event for WindowCloseEvent {
fn get_event_name() -> &'static str {
todo!()
}
fn get_event_type() -> crate::event::EventType {
todo!()
}
fn emit(){
}
}
impl WindowEvent for WindowCloseEvent {
}