Macro score::set_value [] [src]

macro_rules! set_value {
    ($effector:ident, $target:ident . $field:ident = $value:expr) => { ... };
}

Type safe way to update the simulation [Store].

Examples

use score::*;

struct InterfaceComponent
{
    tx_packets: IntValue,
}

fn reset(iface: InterfaceComponent, mut effector: Effector)
{
    // The effector is actually the object that is updated.
    // When the component finishes processing the current event
    // the simulation will apply all the effects from effectors.
    set_value!(effector, iface.tx_packets = 0);
}