Add alias_ member to the Actor class.

This commit is contained in:
Brandon W
2025-04-07 17:14:10 -04:00
committed by teejusb
parent 8da765c3c6
commit 448a2be7cd
4 changed files with 31 additions and 2 deletions
+10
View File
@@ -193,6 +193,7 @@ Actor::Actor( const Actor &cpy ):
#define CPY(x) x = cpy.x
CPY( m_sName );
CPY(alias_);
CPY( m_pParent );
CPY( m_FakeParent );
CPY( m_pLuaInstance );
@@ -272,6 +273,7 @@ Actor &Actor::operator=(Actor other)
using std::swap;
#define SWAP(x) swap(x, other.x)
SWAP( m_sName );
SWAP(alias_);
SWAP( m_pParent );
SWAP( m_FakeParent );
SWAP( m_pLuaInstance );
@@ -336,6 +338,14 @@ Actor &Actor::operator=(Actor other)
return *this;
}
bool Actor::IsAlias(const std::string& name) {
if (alias_.empty()) {
return false;
}
return name == alias_;
}
/* XXX: This calls InitCommand, which must happen after all other
* initialization (eg. ActorFrame loading children). However, it
* also loads input variables, which should happen first. The