Crates.io | echo-d |
lib.rs | echo-d |
version | 0.0.0 |
source | src |
created_at | 2024-02-03 18:31:35.75212 |
updated_at | 2024-02-03 18:31:35.75212 |
description | ECS networking |
homepage | |
repository | |
max_upload_size | |
id | 1125579 |
size | 104,991 |
Fast, simple network layer for Entity-Component Systems
Echo-D (rs)Distributed Entity-Component network protocol for Rust |
Install Echo-D with cargo
cargo install echo-d
Here is an example snippet that shows the basic usage of Echo-D:
use log::info;
use crate:echo-d::{Handler, Context, Options}
const context = new Context({
// events
});
fn responder(data) => {
otherEchoD.many(data)
}
fn onUpdate() {
// events.emit('update')
}
const options = new Options({
responder: responder,
onUpdate: onUpdate,
});
const echoD = new EchoD(context, options);
echoD.spawnActor('actor')
const input = Input { type: 'jump' }
echoD.actorInput('actor', input)
echoD.spawnEntity('entity')
echoD.upsertComponent('entity', 'component', 'value')
fn onUpdated() {
info!('update finished');
}
const update = echoD.updater()
update.then(onUpdated)
Please refer to the documentation for more detailed information:
Echo-D (rs) is developed and tested for rust
.
It is required to have rust
installed for development.
To build a WASM module, run the following command:
# TODO
To run tests, run the following command:
# TODO