GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
Behavior.h
1 /*
2  * GDevelop Core
3  * Copyright 2008-2016 Florian Rival ([email protected]). All rights
4  * reserved. This project is released under the MIT License.
5  */
6 #ifndef GDCORE_BEHAVIOR_H
7 #define GDCORE_BEHAVIOR_H
8 
9 #include "GDCore/String.h"
10 #include "GDCore/Project/BehaviorConfigurationContainer.h"
11 
12 namespace gd {
13 
23 class GD_CORE_API Behavior: public BehaviorConfigurationContainer {
24  public:
25 
26  Behavior(): BehaviorConfigurationContainer(), isDefaultBehavior(false) {};
27  Behavior(const gd::String& name_, const gd::String& type_)
28  : BehaviorConfigurationContainer(name_, type_),
29  isDefaultBehavior(false) {};
30  virtual ~Behavior();
31  virtual Behavior* Clone() const override { return new Behavior(*this); }
32 
33  bool IsDefaultBehavior() const {
34  return isDefaultBehavior;
35  }
36 
37  void SetDefaultBehavior(bool isDefaultBehavior_) {
38  isDefaultBehavior = isDefaultBehavior_;
39  }
40 
41  private:
42  bool isDefaultBehavior;
43 };
44 
45 } // namespace gd
46 
47 #endif // GDCORE_BEHAVIOR_H
Base class for containers of behavior configuration. They can be attached to objects (Behavior) or la...
Definition: BehaviorConfigurationContainer.h:32
Base class used to represents a behavior that can be applied to an object. It stores the content (i....
Definition: Behavior.h:23
String represents an UTF8 encoded string.
Definition: String.h:31
Definition: CommonTools.h:24
bool GD_CORE_API IsDefaultBehavior(const gd::ObjectsContainer &project, const gd::ObjectsContainer &layout, gd::String objectOrGroupName, gd::String behaviorName, bool searchInGroups)
Check if a behavior is a default one or doesn't exist in an object or all objects of a group.
Definition: Layout.cpp:643