Changeset 66
- Timestamp:
- 05/31/13 02:32:49 (12 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/object.hh
r64 r66 129 129 * @returns parent object of current object 130 130 */ 131 object* get_parent() const { return m_parent; }131 virtual object* get_parent() const { return m_parent; } 132 132 133 133 /** … … 140 140 */ 141 141 int get_lua_index() const { return m_lua_index; } 142 143 /** 144 * Moves object to back of child list (top of stack) 145 * 146 * @returns true if object found, false otherwise 147 */ 148 bool move_to_top( object* child ); 149 150 /** 151 * Moves object to front of child list (bottom of stack) 152 * 153 * @returns true if object found, false otherwise 154 */ 155 bool move_to_bottom( object* child ); 142 156 143 157 list::iterator begin() { return m_children.begin(); } -
trunk/src/object.cc
r64 r66 138 138 } 139 139 140 bool object::move_to_top( object* child ) 141 { 142 list::iterator it = std::find( m_children.begin(), m_children.end(), child ); 143 if ( it != m_children.end() ) 144 { 145 m_children.erase( it ); 146 m_children.push_back( child ); 147 return true; 148 } 149 return false; 150 } 151 152 bool object::move_to_bottom( object* child ) 153 { 154 list::iterator it = std::find( m_children.begin(), m_children.end(), child ); 155 if ( it != m_children.end() ) 156 { 157 m_children.erase( it ); 158 m_children.push_front( child ); 159 return true; 160 } 161 return false; 162 } 163 140 164 void object::register_type( type_database* db ) 141 165 {
Note: See TracChangeset
for help on using the changeset viewer.