diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-05-15 19:55:43 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-05-15 19:55:43 +0000 |
| commit | fdd0eec1d145fb8ac97b4cc9aaed5218214416ec (patch) | |
| tree | 2389a0d53fe3eaa644ccb220345995feec748823 /general | |
| parent | 77124f3f105ea3837022d20a49028309a211c4b0 (diff) | |
| download | sigen-fdd0eec1d145fb8ac97b4cc9aaed5218214416ec.tar.gz sigen-fdd0eec1d145fb8ac97b4cc9aaed5218214416ec.tar.xz sigen-fdd0eec1d145fb8ac97b4cc9aaed5218214416ec.zip | |
[FIX] Refactored out connections made within widgets
[FIX] Flag, Fractiona, and Point widgets fixed to only emit signals when actually changed
[FIX] Pokemod classes now emit signals
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@138 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'general')
| -rw-r--r-- | general/Flag.h | 19 | ||||
| -rw-r--r-- | general/Fraction.h | 16 |
2 files changed, 34 insertions, 1 deletions
diff --git a/general/Flag.h b/general/Flag.h index bb9548f3..55b3a73d 100644 --- a/general/Flag.h +++ b/general/Flag.h @@ -38,9 +38,26 @@ class Flag void set(const int flag, const int status); void setFlag(const int flag); void setStatus(const int status); - + int flag() const; int status() const; + + inline Flag& operator=(const Flag& rhs) + { + if (this == &rhs) + return *this; + m_flag = rhs.m_flag; + m_status = rhs.m_status; + return *this; + } + inline bool operator==(const Flag& rhs) const + { + return ((m_flag == rhs.m_flag) && (m_status == rhs.m_status)); + } + inline bool operator!=(const Flag& rhs) const + { + return !(*this == rhs); + } private: int m_flag; int m_status; diff --git a/general/Fraction.h b/general/Fraction.h index 99b6eeec..2c1dc663 100644 --- a/general/Fraction.h +++ b/general/Fraction.h @@ -62,6 +62,22 @@ class Fraction { return Fraction(m_numerator * rhs.m_numerator, m_denominator * rhs.m_denominator); } + inline Fraction& operator=(const Fraction& rhs) + { + if (this == &rhs) + return *this; + m_numerator = rhs.m_numerator; + m_denominator = rhs.m_denominator; + return *this; + } + inline bool operator==(const Fraction& rhs) const + { + return ((m_numerator == rhs.m_numerator) && (m_denominator == rhs.m_denominator)); + } + inline bool operator!=(const Fraction& rhs) const + { + return !(*this == rhs); + } private: int m_numerator; int m_denominator; |
