GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
ObjectVariableHelper.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 #pragma once
7 
8 #include "GDCore/Project/VariablesContainer.h"
9 
10 namespace gd {
11 class InitialInstancesContainer;
12 class ObjectsContainersList;
13 class ObjectsContainer;
14 class ObjectGroup;
15 class VariablesContainer;
16 struct VariablesChangeset;
17 } // namespace gd
18 
19 namespace gd {
20 
26 class GD_CORE_API ObjectVariableHelper {
27 public:
37  static void
38  FillAnyVariableBetweenObjects(gd::ObjectsContainer &globalObjectsContainer,
39  gd::ObjectsContainer &objectsContainer,
40  const gd::ObjectGroup &objectGroup);
41 
46  static gd::VariablesContainer MergeVariableContainers(
47  const gd::ObjectsContainersList &objectsContainersList,
48  const gd::ObjectGroup &objectGroup);
49 
58  static void FillMissingGroupVariablesToObjects(
59  gd::ObjectsContainer &globalObjectsContainer,
60  gd::ObjectsContainer &objectsContainer,
61  const gd::ObjectGroup &objectGroup,
62  const gd::SerializerElement &originalSerializedVariables);
63 
68  static void
69  ApplyChangesToObjects(gd::ObjectsContainer &globalObjectsContainers,
70  gd::ObjectsContainer &objectsContainers,
71  const gd::VariablesContainer &groupVariablesContainer,
72  const gd::ObjectGroup &objectGroup,
73  const gd::VariablesChangeset &changeset);
74 
75  static void ApplyChangesToObjectInstances(
76  gd::VariablesContainer &objectVariablesContainer,
77  gd::InitialInstancesContainer &initialInstancesContainer,
78  const gd::String &objectName, const gd::VariablesChangeset &changeset);
79 
80 private:
81  static void ApplyChangesToVariableContainer(
82  const gd::VariablesContainer &originalVariablesContainer,
83  gd::VariablesContainer &destinationVariablesContainer,
84  const gd::VariablesChangeset &changeset, bool shouldApplyValueChanges);
85 };
86 
87 } // namespace gd
Defines a container of gd::InitialInstances.
Definition: InitialInstancesContainer.h:38
Represents an object group.
Definition: ObjectGroup.h:28
Definition: ObjectVariableHelper.h:26
Used as a base class for classes that will own objects (see gd::Object).
Definition: ObjectsContainer.h:37
A list of objects containers, useful for accessing objects in a scoped way, along with methods to acc...
Definition: ObjectsContainersList.h:29
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:33
Class defining a container for gd::Variable.
Definition: VariablesContainer.h:28
Definition: CommonTools.h:24
Definition: WholeProjectRefactorer.h:47