Atoms Crowd  7.0.0
RandomSelector.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/BehaviourTree/Composite.h>
11 #include <Atoms/BehaviourTree/BlackboardValue.h>
12 
13 namespace Atoms
14 {
15  class ATOMS_EXPORT RandomSelector : public Composite
16  {
17 
18  public:
20 
21  virtual ~RandomSelector();
22 
23  virtual const char* typeName() const override;
24 
25  virtual void initialize(BehaviourTreeContext* context, State* data) override;
26 
27  virtual void update(BehaviourTreeContext* context, State* data) override;
28 
29  virtual void terminate(BehaviourTreeContext* context, State* data) override;
30 
31  virtual void releaseData(BehaviourTreeContext* context, State* data) override;
32 
33  virtual void onChildUpdated(BehaviourTreeContext* context, State* data, unsigned int childIndex, unsigned short childStatus) override;
34 
35  virtual void setAttributes(const AtomsCore::MapMetadata* attributes, Blackboard* blackboard) override;
36 
37  virtual void getAttributes(AtomsCore::MapMetadata* attributes, Blackboard* blackboard) override;
38 
39  virtual void getAttributeProperties(AtomsCore::MapMetadata* attributes) override;
40 
41  static Behaviour* creator();
42 
43  private:
44 
45  BlackboardIntValue m_seed;
46 
47  bool m_useAgentIdAsSeed;
48 
49  bool m_useAnimatedSeed;
50  };
51 }
Definition: Behaviour.h:21
Definition: BehaviourTreeContext.h:24
Definition: Blackboard.h:35
Definition: Composite.h:18
Definition: RandomSelector.h:16
MapMetadata class.
Definition: MapMetadata.h:24
Atoms namespace.
Definition: Agent.h:29
Definition: Behaviour.h:34