initial arhitectural overhaul

Signed-off-by: Sienna Meridian Satterwhite <sienna@r3t.io>
This commit is contained in:
2025-12-13 22:22:05 +00:00
parent b098a19d6b
commit 5cb258fe6b
99 changed files with 4137 additions and 311 deletions

View File

@@ -0,0 +1,71 @@
//! Events emitted from the Core Engine to Bevy
use crate::networking::{NodeId, SessionId, VectorClock};
use bevy::prelude::*;
use uuid::Uuid;
/// Events that the Core Engine emits to Bevy
#[derive(Debug, Clone)]
pub enum EngineEvent {
// Networking status
NetworkingStarted {
session_id: SessionId,
node_id: NodeId,
},
NetworkingFailed {
error: String,
},
NetworkingStopped,
SessionJoined {
session_id: SessionId,
},
SessionLeft,
// Peer events
PeerJoined {
node_id: NodeId,
},
PeerLeft {
node_id: NodeId,
},
// CRDT sync events
EntitySpawned {
entity_id: Uuid,
position: Vec3,
rotation: Quat,
version: VectorClock,
},
EntityUpdated {
entity_id: Uuid,
position: Vec3,
rotation: Quat,
version: VectorClock,
},
EntityDeleted {
entity_id: Uuid,
version: VectorClock,
},
// Lock events
LockAcquired {
entity_id: Uuid,
holder: NodeId,
},
LockReleased {
entity_id: Uuid,
},
LockDenied {
entity_id: Uuid,
current_holder: NodeId,
},
LockExpired {
entity_id: Uuid,
},
// Clock events
ClockTicked {
sequence: u64,
clock: VectorClock,
},
}