Atoms Crowd  7.0.0
BehaviourTreeMaps.h
1 #pragma once
2 // ===========================================================================
3 // Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
4 //
5 // Use of this software is subject to the terms of the Toolchefs license
6 // agreement provided at the time of installation or download, or which
7 // otherwise accompanies this software in either electronic or hard copy form.
8 // ===========================================================================
9 
10 #include <Atoms/Globals.h>
11 #include <Atoms/BehaviourTree/BehaviourTree.h>
12 #include <map>
13 #include <vector>
14 
15 namespace Atoms
16 {
18 
21  typedef AtomsPtr<AtomsCore::MapMetadata> BehaviourTreeMapPtr;
22 
23  class ATOMS_EXPORT BehaviourTreeMaps
24  {
25  public:
26 
29 
31 
35  BehaviourTreeMapPtr behaviourTreeMap(const std::string& name) const;
36 
38 
42  BehaviourTreeMapPtr behaviourTreeMap(const std::string& name);
43 
45 
49  BehaviourTreeMapPtr addBehaviourTreeMap(const std::string& name, const AtomsCore::MapMetadata &behaviourTreeMap, bool replace = true);
50 
52 
56  BehaviourTreeMapPtr addBehaviourTreeMap(const std::string& name, AtomsCore::MapMetadata &behaviourTreeMap, bool replace = true);
57 
59 
62  void removeBehaviourTreeMap(const std::string& name);
63 
65 
68  std::vector<std::string> behaviourTreeMapNames();
69 
71 
75  bool behaviourTreeMapExists(const std::string& name);
76 
78  unsigned int numBehaviourTreeMaps();
79 
81  void clear();
82 
84  bool buildBehaviourTree(const std::string &name, Atoms::BehaviourTree &behaviourTree);
85 
88 
90  void getAllBlackboardExposeKeys(const std::string &name, AtomsCore::MapMetadata &exposeKeys);
91 
92  private:
93 
96 
99 
102 
103  typedef std::map<std::string, BehaviourTreeMapPtr> BehaviourTreesMap;
104 
106 
109  BehaviourTreesMap m_behaviourTreesMap;
110  };
111 }
Definition: BehaviourTree.h:27
Definition: BehaviourTreeMaps.h:24
void getAllBlackboardExposeKeys(const std::string &name, AtomsCore::MapMetadata &exposeKeys)
gets all the blackboard keys to expose in the host app
std::vector< std::string > behaviourTreeMapNames()
Get all behaviour tree names.
bool buildBehaviourTree(const std::string &name, Atoms::BehaviourTree &behaviourTree)
builds a behaviour tree from the map name
BehaviourTreeMapPtr behaviourTreeMap(const std::string &name) const
Return an behaviour trees.
BehaviourTreeMapPtr addBehaviourTreeMap(const std::string &name, AtomsCore::MapMetadata &behaviourTreeMap, bool replace=true)
Add an behaviour tree to the map.
BehaviourTreeMapPtr behaviourTreeMap(const std::string &name)
Return an behaviour trees.
bool buildBehaviourTreeFromMap(const BehaviourTreeMapPtr &map, Atoms::BehaviourTree &behaviourTree)
builds a behaviour tree from a behaviour tree map
static BehaviourTreeMaps & instance()
Singleton access.
unsigned int numBehaviourTreeMaps()
Get number of behaviour trees.
void removeBehaviourTreeMap(const std::string &name)
Remove an behaviour tree from the map.
bool behaviourTreeMapExists(const std::string &name)
Check if an behaviour tree exists.
BehaviourTreeMapPtr addBehaviourTreeMap(const std::string &name, const AtomsCore::MapMetadata &behaviourTreeMap, bool replace=true)
Add an behaviour tree to the map.
void clear()
Remove all behaviour trees.
MapMetadata class.
Definition: MapMetadata.h:24
Atoms namespace.
Definition: Agent.h:29
AtomsPtr< AtomsCore::MapMetadata > BehaviourTreeMapPtr
behaviour trees manager
Definition: BehaviourTreeMaps.h:21