GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
VariableInstructionSwitcher.h
1 /*
2  * GDevelop Core
3  * Copyright 2008-present Florian Rival ([email protected]). All rights
4  * reserved. This project is released under the MIT License.
5  */
6 #pragma once
7 #include "GDCore/Project/Variable.h"
8 #include "GDCore/String.h"
9 
10 namespace gd {
11 class Instruction;
12 class Platform;
13 class ProjectScopedContainers;
14 } // namespace gd
15 
16 namespace gd {
26 class GD_CORE_API VariableInstructionSwitcher {
27 public:
32  static bool
33  IsSwitchableVariableInstruction(const gd::String &instructionType);
34 
39  static bool
40  IsSwitchableObjectVariableInstruction(const gd::String &instructionType);
41 
49  static const gd::String &
50  GetSwitchableVariableInstructionIdentifier(const gd::String &instructionType);
51 
55  static const gd::Variable::Type
56  GetSwitchableInstructionVariableType(const gd::String &instructionType);
57 
61  static void
62  SwitchVariableInstructionType(gd::Instruction &instruction,
63  const gd::Variable::Type variableType);
64 
68  static const gd::Variable::Type GetVariableTypeFromParameters(
69  const gd::Platform &platform,
70  const gd::ProjectScopedContainers &projectScopedContainers,
71  const gd::Instruction &instruction);
72 
77  static void SwitchBetweenUnifiedInstructionIfNeeded(
78  const gd::Platform &platform,
79  const gd::ProjectScopedContainers &projectScopedContainers,
80  gd::Instruction &instruction);
81 
82 private:
83  static const gd::String variableGetterIdentifier;
84  static const gd::String variableSetterIdentifier;
85  static const gd::String variablePushIdentifier;
86  static const gd::String objectVariableGetterIdentifier;
87  static const gd::String objectVariableSetterIdentifier;
88  static const gd::String objectVariablePushIdentifier;
89  static const gd::String unknownInstructionIdentifier;
90 };
91 } // namespace gd
An instruction is a member of an event: It can be a condition or an action.
Definition: Instruction.h:30
Base class for implementing a platform.
Definition: Platform.h:42
Holds references to variables, objects, properties and other containers.
Definition: ProjectScopedContainers.h:36
String represents an UTF8 encoded string.
Definition: String.h:31
Type
Definition: Variable.h:32
Definition: VariableInstructionSwitcher.h:26
Definition: CommonTools.h:24