mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 11:46:42 +01:00
parent
9f7d0efda5
commit
85c305385b
1 changed files with 3 additions and 2 deletions
|
|
@ -18,7 +18,7 @@ type EventMapImpl<E, C> = BTreeMap<E, Vec<Binding<C>>>;
|
||||||
pub struct EventMap<E, C>(EventMapImpl<E, C>);
|
pub struct EventMap<E, C>(EventMapImpl<E, C>);
|
||||||
|
|
||||||
/// An input binding.
|
/// An input binding.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Binding<C> {
|
pub struct Binding<C> {
|
||||||
pub command: C,
|
pub command: C,
|
||||||
pub condition: Option<Condition>,
|
pub condition: Option<Condition>,
|
||||||
|
|
@ -27,7 +27,8 @@ pub struct Binding<C> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Input bindings are only returned if this evaluates to true
|
/// Input bindings are only returned if this evaluates to true
|
||||||
pub struct Condition(Box<dyn Fn()->bool + Send + Sync>);
|
#[derive(Clone)]
|
||||||
|
pub struct Condition(Arc<Box<dyn Fn()->bool + Send + Sync>>);
|
||||||
|
|
||||||
impl_debug!(Condition |self, w| { write!(w, "*") });
|
impl_debug!(Condition |self, w| { write!(w, "*") });
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue