Code example for Predicate

Methods: apply

0
     *            the input states to check 
     * @param tpf 
     *            the time per frame in seconds 
     */ 
    void performIfValid(final Canvas source, final TwoInputStates states, final double tpf) { 
        if (_condition.apply(states)) { 
            _action.perform(source, states, tpf); 
        } 
    } 
 
    /** 
     * @param id 
     *            the id to set. This id can be used to uniquely identify a trigger. 
     */ 
    public void setId(final String id) { 
        _id = id; 
    } 
 
    /** 
     * @return the id set, or null if none was set.