#pragma once
#include "../../../../Utils/Process/FSM/Condition.h"
#include <functional>

template<class T0, class T1, class Op=std::logical_and<bool>>
struct CompositeCondition
{
  CompositeCondition(T0 c0, T1 c1, Op op=Op())
    : m_c0(c0)
    , m_c1(c1)
    , m_op(op)
  {}

  bool evaluate() const
  {
    return m_op(m_c0.evaluate(), m_c1.evaluate());
  }

  bool evaluate()
  {
    return m_op(m_c0.evaluate(), m_c1.evaluate());
  }

private:
  T0 m_c0;
  T1 m_c1;
  Op m_op;
};