pub fn apply(&self, input: &PieceValue) -> Option<PuzzleConsequence<B>> {
    match self {
      ConsequenceValueMatcher::NumToProperty(property) => match input {
        PieceValue::Num(v) => Some(PuzzleConsequence::ClientStateUpdate(property, crate::PropertyValue::Num(*v))),
        _ => None,
      },
      ConsequenceValueMatcher::BoolToProperty(property) => match input {
        PieceValue::Bool(v) => Some(PuzzleConsequence::ClientStateUpdate(property, crate::PropertyValue::Bool(*v))),
        _ => None,
      },
      ConsequenceValueMatcher::BoolToMap(tile) => match input {
        PieceValue::Bool(v) => Some(PuzzleConsequence::UpdateMap(tile, *v)),
        _ => None,
      },
      ConsequenceValueMatcher::BoolToMapInverted(tile) => match input {
        PieceValue::Bool(v) => Some(PuzzleConsequence::UpdateMap(tile, !*v)),
        _ => None,
      },
      ConsequenceValueMatcher::NumToBoolProperty { reference, comparison, property } => match input {
        PieceValue::Num(v) => Some(PuzzleConsequence::ClientStateUpdate(property, crate::PropertyValue::Bool(comparison.compare(*v, *reference)))),
        _ => None,
      },
      ConsequenceValueMatcher::NumToBoolMap { reference, comparison, map } => match input {
        PieceValue::Num(v) => Some(PuzzleConsequence::UpdateMap(map, comparison.compare(*v, *reference))),
        _ => None,
      },
    }
  }
/// Determine if there is a consequence event from this value
Determine if there is a consequence event from this value
Determine if there is a consequence event from this value
pub fn apply(&self, input: &PieceValue) -> Option<PuzzleConsequence<B>> {
    match self {
      ConsequenceValueMatcher::NumToProperty(property) => match input {
        PieceValue::Num(v) => Some(PuzzleConsequence::ClientStateUpdate(property, crate::PropertyValue::Num(*v))),
        _ => None,
      },
      ConsequenceValueMatcher::BoolToProperty(property) => match input {
        PieceValue::Bool(v) => Some(PuzzleConsequence::ClientStateUpdate(property, crate::PropertyValue::Bool(*v))),
        _ => None,
      },
      ConsequenceValueMatcher::BoolToMap(tile) => match input {
        PieceValue::Bool(v) => Some(PuzzleConsequence::UpdateMap(tile, *v)),
        _ => None,
      },
      ConsequenceValueMatcher::BoolToMapInverted(tile) => match input {
        PieceValue::Bool(v) => Some(PuzzleConsequence::UpdateMap(tile, !*v)),
        _ => None,
      },
      ConsequenceValueMatcher::NumToBoolProperty { reference, comparison, property } => match input {
        PieceValue::Num(v) => Some(PuzzleConsequence::ClientStateUpdate(property, crate::PropertyValue::Bool(comparison.compare(*v, *reference)))),
        _ => None,
      },
      ConsequenceValueMatcher::NumToBoolMap { reference, comparison, map } => match input {
        PieceValue::Num(v) => Some(PuzzleConsequence::UpdateMap(map, comparison.compare(*v, *reference))),
        _ => None,
      },
    }
  }
pub fn apply ( & self , input : & PieceValue ) -> Option < PuzzleConsequence < B > > { match self { ConsequenceValueMatcher :: NumToProperty ( property ) => match input { PieceValue :: Num ( v ) => Some ( PuzzleConsequence :: ClientStateUpdate ( property , crate :: PropertyValue :: Num ( * v ) ) ) , _ => None , } , ConsequenceValueMatcher :: BoolToProperty ( property ) => match input { PieceValue :: Bool ( v ) => Some ( PuzzleConsequence :: ClientStateUpdate ( property , crate :: PropertyValue :: Bool ( * v ) ) ) , _ => None , } , ConsequenceValueMatcher :: BoolToMap ( tile ) => match input { PieceValue :: Bool ( v ) => Some ( PuzzleConsequence :: UpdateMap ( tile , * v ) ) , _ => None , } , ConsequenceValueMatcher :: BoolToMapInverted ( tile ) => match input { PieceValue :: Bool ( v ) => Some ( PuzzleConsequence :: UpdateMap ( tile , ! * v ) ) , _ => None , } , ConsequenceValueMatcher :: NumToBoolProperty { reference , comparison , property } => match input { PieceValue :: Num ( v ) => Some ( PuzzleConsequence :: ClientStateUpdate ( property , crate :: PropertyValue :: Bool ( comparison . compare ( * v , * reference ) ) ) ) , _ => None , } , ConsequenceValueMatcher :: NumToBoolMap { reference , comparison , map } => match input { PieceValue :: Num ( v ) => Some ( PuzzleConsequence :: UpdateMap ( map , comparison . compare ( * v , * reference ) ) ) , _ => None , } , } }
Determine if there is a consequence event from this value
Determine if there is a consequence event from this value
&self
input
&PieceValue
&self
input
&PieceValue