aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/booleancondition.cpp
blob: 26d806374f77aab0cb3cdba23d0486419b760611 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "booleancondition.h"


BooleanCondition::BooleanCondition()
{
}
bool BooleanCondition::isValid(Die* b) const
{
    switch(m_operator)
    {
    case Equal:
        return (b->getValue()==m_value);
    case GreaterThan:
        return (b->getValue()>m_value);
    case LesserThan:
        return (b->getValue()<m_value);
    case GreaterOrEqual:
        return (b->getValue()>=m_value);
    case LesserOrEqual:
        return (b->getValue()<=m_value);


    }
    return false;
}

void BooleanCondition::setOperator(LogicOperator m)
{
    m_operator = m;
}

void BooleanCondition::setValue(qint64 v)
{
    m_value=v;
}