Etterna 0.74.4
Loading...
Searching...
No Matches
AutoActor.h
1#ifndef AutoActor_H
2#define AutoActor_H
3
4class Actor;
5class XNode;
6
13{
14 public:
15 AutoActor() = default;
16 ~AutoActor() { Unload(); }
17 AutoActor(const AutoActor& cpy);
18 auto operator=(const AutoActor& cpy) -> AutoActor&;
19 operator const Actor*() const { return m_pActor; }
20 operator Actor*() { return m_pActor; }
21 auto operator->() const -> const Actor* { return m_pActor; }
22 auto operator->() -> Actor* { return m_pActor; }
23 void Unload();
27 [[nodiscard]] auto IsLoaded() const -> bool { return m_pActor != nullptr; }
28 void Load(Actor* pActor); // transfer pointer
29 void Load(const std::string& sPath);
30 void LoadB(const std::string& sMetricsGroup,
31 const std::string& sElement); // load a background and set up
32 // LuaThreadVariables for recursive
33 // loading
34 void LoadActorFromNode(const XNode* pNode, Actor* pParent);
35 void LoadAndSetName(const std::string& sScreenName,
36 const std::string& sActorName);
37
38 protected:
40 Actor* m_pActor{ nullptr };
41};
42
43#endif
Base class for all objects that appear on the screen.
Definition Actor.h:77
A smart pointer for Actor.
Definition AutoActor.h:13
Actor * m_pActor
the Actor for which there is a smart pointer to.
Definition AutoActor.h:40
auto IsLoaded() const -> bool
Determine if this actor is presently loaded.
Definition AutoActor.h:27
Definition XmlFile.h:95