Added != operator and copy constructor.

ver1_5_1
Chris Laurel 2002-01-11 00:02:43 +00:00
parent 882ddfdde5
commit ac17ae82cf
1 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,8 @@ class Selection
Selection(Star* _star) : star(_star), body(NULL), galaxy(NULL) {};
Selection(Body* _body) : star(NULL), body(_body), galaxy(NULL) {};
Selection(Galaxy* _galaxy) : star(NULL), body(NULL), galaxy(_galaxy) {};
Selection(const Selection& sel) :
star(sel.star), body(sel.body), galaxy(sel.galaxy) {};
~Selection() {};
bool empty() { return star == NULL && body == NULL && galaxy == NULL; };
@ -41,4 +43,9 @@ inline bool operator==(const Selection& s0, const Selection& s1)
return s0.star == s1.star && s0.body == s1.body && s0.galaxy == s1.galaxy;
}
inline bool operator!=(const Selection& s0, const Selection& s1)
{
return s0.star != s1.star || s0.body != s1.body || s0.galaxy != s1.galaxy;
}
#endif // _CELENGINE_SELECTION_H_