mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
The "null" ButtonHandle and TypeHandle now evaluate to false
This commit is contained in:
parent
82e4500d2a
commit
24d705b031
@ -275,6 +275,17 @@ none() {
|
||||
return _none;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: TypeHandle::operator bool
|
||||
// Access: Published
|
||||
// Description: TypeHandle::none() evaluates to false, everything
|
||||
// else evaluates to true.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE TypeHandle::
|
||||
operator bool () const {
|
||||
return (_index != 0);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: get_best_parent_from_Set
|
||||
// Access: Published
|
||||
@ -295,4 +306,3 @@ INLINE int TypeHandle::get_best_parent_from_Set(const std::set< int > &legal_va
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -146,6 +146,7 @@ PUBLISHED:
|
||||
INLINE int get_index() const;
|
||||
INLINE void output(ostream &out) const;
|
||||
INLINE static TypeHandle none();
|
||||
INLINE operator bool () const;
|
||||
|
||||
private:
|
||||
int _index;
|
||||
|
@ -135,7 +135,7 @@ get_index() const {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: ButtonHandle::output
|
||||
// Access: Published
|
||||
// Description:
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void ButtonHandle::
|
||||
output(ostream &out) const {
|
||||
@ -152,3 +152,14 @@ INLINE ButtonHandle ButtonHandle::
|
||||
none() {
|
||||
return _none;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: ButtonHandle::operator bool
|
||||
// Access: Published
|
||||
// Description: ButtonHandle::none() evaluates to false, everything
|
||||
// else evaluates to true.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ButtonHandle::
|
||||
operator bool () const {
|
||||
return (_index != 0);
|
||||
}
|
||||
|
@ -51,6 +51,8 @@ PUBLISHED:
|
||||
INLINE void output(ostream &out) const;
|
||||
INLINE static ButtonHandle none();
|
||||
|
||||
INLINE operator bool () const;
|
||||
|
||||
private:
|
||||
int _index;
|
||||
static ButtonHandle _none;
|
||||
|
Loading…
x
Reference in New Issue
Block a user