TrueReality  v0.1.1912
DirectorBase.h
Go to the documentation of this file.
1 /*
2 * True Reality Open Source Game and Simulation Engine
3 * Copyright © 2021 Acid Rain Studios LLC
4 *
5 * This library is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License as published by the Free
7 * Software Foundation; either version 3.0 of the License, or (at your option)
8 * any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this library; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * @author Maxim Serebrennik
20 */
21 
22 #pragma once
23 
24 #include "Export.h"
25 
26 #include <trBase/SmrtPtr.h>
28 #include <trManager/EntityBase.h>
29 #include <trManager/ActorBase.h>
30 
31 namespace trManager
32 {
40  {
41  public:
43 
44  const static trUtil::RefStr CLASS_TYPE;
45 
53  DirectorBase(const std::string& name = CLASS_TYPE);
54 
65  static bool CompareComponentPriority(const trBase::SmrtPtr<trManager::EntityBase>& first, const trBase::SmrtPtr<trManager::EntityBase>& second);
66 
74  virtual const std::string& GetType() const override = 0;
75 
83  virtual void OnTick(const trManager::MessageBase& msg);
84 
92  virtual void OnMessage(const trManager::MessageBase& msg);
93 
99  virtual void BuildInvokables() override;
100 
108  virtual trManager::DirectorPriority& GetDirectorPriority() const;
109 
117  virtual void SetDirectorPriority(trUtil::EnumerationPointer<trManager::DirectorPriority> priority);
118 
119  protected:
120 
126  ~DirectorBase();
127 
128  private:
129 
131  };
132 }
Sets the priority for a Director instance.
A string wrapper that will make sure that all of the strings with the same value will point to the sa...
Definition: RefStr.h:50
A director base.
Definition: DirectorBase.h:39
trUtil::EnumerationPointer< trManager::DirectorPriority > mDirectorPriority
Definition: DirectorBase.h:130
static const trUtil::RefStr CLASS_TYPE
Adds an easy and swappable access to the base class.
Definition: DirectorBase.h:44
This class is part of the internal garbage collection system.
Definition: SmrtClass.h:38
A base class for all actors in the entity system.
Definition: ActorBase.h:41
This is the base class for all the messages in TR.
Definition: MessageBase.h:40
#define TR_MANAGER_EXPORT