Atoms Crowd  4.1.0
Decorator.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/Behaviour.h>
12 
13 namespace Atoms
14 {
15  class ATOMS_EXPORT Decorator : public Behaviour
16  {
17  public:
18 
19  Decorator();
20 
21  virtual ~Decorator();
22 
23  virtual const char* typeName() const override;
24 
25  virtual void addChild(unsigned short index) override;
26 
27  virtual void setAttributes(const AtomsCore::MapMetadata* attributes, Blackboard* blackboard) override;
28 
29  virtual void getAttributes(AtomsCore::MapMetadata* attributes, Blackboard* blackboard) override;
30 
31  virtual void getAttributeProperties(AtomsCore::MapMetadata* attributes) override;
32 
33  public:
34 
35  unsigned short childIndex;
36  };
37 
38 
39  class ATOMS_EXPORT Root : public Decorator
40  {
41  public:
42 
43  Root();
44 
45  virtual ~Root();
46 
47  static const char* staticTypeName();
48 
49  virtual const char* typeName() const override;
50 
51  virtual void initialize(BehaviourTreeContext* context, State* data) override;
52 
53  virtual void update(BehaviourTreeContext* context, State* data) override;
54 
55  virtual void onChildUpdated(BehaviourTreeContext* context, State* data, unsigned int childIndex, unsigned short childStatus) override;
56 
57  virtual void getAttributeProperties(AtomsCore::MapMetadata* attributes) override;
58 
59  static Behaviour* creator();
60  };
61 }
Atoms::Blackboard
Definition: Blackboard.h:35
Atoms::Decorator
Definition: Decorator.h:16
Atoms::Behaviour::State
Definition: Behaviour.h:34
Atoms
Atoms namespace.
Definition: Agent.h:28
AtomsCore::MapMetadata
MapMetadata class.
Definition: MapMetadata.h:24
Atoms::Root
Definition: Decorator.h:40
Atoms::Behaviour
Definition: Behaviour.h:21
Atoms::BehaviourTreeContext
Definition: BehaviourTreeContext.h:24