GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
ObjectGroup.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 
7 #ifndef GDCORE_OBJECTGROUP_H
8 #define GDCORE_OBJECTGROUP_H
9 #include <utility>
10 #include <vector>
11 
12 #include "GDCore/String.h"
13 
14 namespace gd {
15 class SerializerElement;
16 }
17 
18 namespace gd {
19 
28 class GD_CORE_API ObjectGroup {
29  public:
30  ObjectGroup(){};
31  virtual ~ObjectGroup(){};
32 
36  bool Find(const gd::String& name) const;
37 
41  void AddObject(const gd::String& name);
42 
46  void RemoveObject(const gd::String& name);
47 
51  void RenameObject(const gd::String& oldName, const gd::String& newName);
52 
55  inline const gd::String& GetName() const { return name; };
56 
59  inline void SetName(const gd::String& name_) { name = name_; };
60 
64  inline const std::vector<gd::String>& GetAllObjectsNames() const {
65  return memberObjects;
66  }
67 
71  void SerializeTo(SerializerElement& element) const;
72 
76  void UnserializeFrom(const SerializerElement& element);
77 
78  private:
79  std::vector<gd::String> memberObjects;
80  gd::String name;
81 };
82 
83 } // namespace gd
84 
85 #endif // GDCORE_OBJECTGROUP_H
Represents an object group.
Definition: ObjectGroup.h:28
const std::vector< gd::String > & GetAllObjectsNames() const
Get a vector with objects names.
Definition: ObjectGroup.h:64
const gd::String & GetName() const
Get group name.
Definition: ObjectGroup.h:55
void SetName(const gd::String &name_)
Change group name.
Definition: ObjectGroup.h:59
A generic container that can represent a value ( containing a string, double, bool or int),...
Definition: SerializerElement.h:37
String represents an UTF8 encoded string.
Definition: String.h:31
Definition: CommonTools.h:24