BrandonDyer64 / bevy_wasm

Mod Bevy games with WASM
Apache License 2.0
94 stars 4 forks source link

Custom connection struct in favor of event writers #15

Open BrandonDyer64 opened 1 year ago

BrandonDyer64 commented 1 year ago

Currently, communication is handled through Bevy's EventReader and EventWriter. What I'd like is some kind of ModConnection struct instead that maps directly to the ffi calls rather than overly abstracting them.

Current:

fn system(in: EventReader<In>, out: EventWriter<Out>)

Proposed:

fn system(conn: ModConnection<In, Out>)

Perhaps a standardized Protocol type could be established that would hold these more obtuse types. i.e.

fn system(conn: ModConnection<MyProtocol>)