crystalorb-mock-network
Provides an implementation of crystalorb::network_recource::NetworkResource
that works offline, backed using VecDeque
, allowing CrystalOrb
to work offline for demo and testing purposes.
Usage
use MockNetwork;
use DemoWorld;
use ;
let =
;
let client_1 = new;
let client_2 = new;
let server = new;
// You need to manually call connect.
client_1_net.connect;
client_2_net.connect;
// (You can also simulate a disconnection later on)
// client_1_net.disconnect();
// client_2_net.disconnect();
// (You can also set the latency of each connection)
// client_1_net.set_delay(number_of_seconds_as_f64);
// Later, in your update loop: