GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
PropertyFunctionGenerator.h
1 /*
2  * GDevelop Core
3  * Copyright 2008-2022 Florian Rival ([email protected]). All rights
4  * reserved. This project is released under the MIT License.
5  */
6 #pragma once
7 
8 namespace gd {
9 class String;
10 class Project;
11 class EventsFunctionsExtension;
12 class EventsFunction;
13 class EventsBasedBehavior;
14 class EventsBasedObject;
15 class AbstractEventsBasedEntity;
16 class PropertyDescriptor;
17 class NamedPropertyDescriptor;
18 } // namespace gd
19 
20 namespace gd {
21 
25 class GD_CORE_API PropertyFunctionGenerator {
26  public:
30  static void GenerateBehaviorGetterAndSetter(
31  gd::Project &project,
33  gd::EventsBasedBehavior &eventsBasedBehavior,
34  const gd::NamedPropertyDescriptor &property,
35  bool isSharedProperties);
39  static void GenerateObjectGetterAndSetter(
40  gd::Project &project,
42  gd::EventsBasedObject &eventsBasedObject,
43  const gd::NamedPropertyDescriptor &property);
44  static bool CanGenerateGetterAndSetter(
45  const gd::AbstractEventsBasedEntity &eventsBasedEntity,
46  const gd::NamedPropertyDescriptor &property);
47 
51  static void GenerateConditionSkeleton(gd::Project &project,
52  gd::EventsFunction &eventsFunction);
53 
57  static void GenerateExpressionSkeleton(gd::Project &project,
58  gd::EventsFunction &eventsFunction);
59 
63  static void UpdateReturnActionType(
64  gd::Project &project, gd::EventsFunction &eventsFunction);
65 
67 
68  private:
69  static void GenerateGetterAndSetter(
70  gd::Project &project,
72  gd::AbstractEventsBasedEntity &eventsBasedEntity,
73  const gd::NamedPropertyDescriptor &property,
74  const gd::String &objectType,
75  bool isBehavior,
76  bool isSharedProperties);
77 
78  static gd::String CapitalizeFirstLetter(const gd::String &string);
79  static gd::String UnCapitalizeFirstLetter(const gd::String &string);
80  static gd::String GetStringifiedExtraInfo(
81  const gd::PropertyDescriptor &property);
82 
84 };
85 
86 } // namespace gd
Represents a behavior or an object that is implemented with events.
Definition: AbstractEventsBasedEntity.h:29
Represents a behavior that is implemented with events.
Definition: EventsBasedBehavior.h:31
Represents an object that is implemented with events.
Definition: EventsBasedObject.h:32
Events that can be generated as a stand-alone function, and used as a condition, action or expression...
Definition: EventsFunction.h:38
Hold a list of Events Functions (gd::EventsFunction) and Events Based Behaviors.
Definition: EventsFunctionsExtension.h:41
Used to describe a property shown in a property grid.
Definition: NamedPropertyDescriptor.h:21
Base class representing a project (game), including all resources, scenes, objects,...
Definition: Project.h:51
Used to describe a property shown in a property grid.
Definition: PropertyDescriptor.h:38
Generate a getter and a setter functions for properties.
Definition: PropertyFunctionGenerator.h:25
String represents an UTF8 encoded string.
Definition: String.h:33
Definition: CommonTools.h:24