12 #include "GDCore/Events/CodeGeneration/DiagnosticReport.h"
13 #include "GDCore/Project/ExtensionProperties.h"
14 #include "GDCore/Project/LoadingScreen.h"
15 #include "GDCore/Project/ObjectGroupsContainer.h"
16 #include "GDCore/Project/ObjectsContainer.h"
17 #include "GDCore/Project/PlatformSpecificAssets.h"
18 #include "GDCore/Project/ResourcesContainer.h"
19 #include "GDCore/Project/TestsContainer.h"
20 #include "GDCore/Project/VariablesContainer.h"
21 #include "GDCore/Project/Watermark.h"
22 #include "GDCore/Project/MemoryTrackedRegistry.h"
23 #include "GDCore/String.h"
28 class ResourcesContainer;
30 class EventsFunctionsExtension;
31 class EventsBasedObject;
32 class EventsBasedBehavior;
34 class ObjectConfiguration;
35 class VariablesContainer;
36 class ArbitraryResourceWorker;
38 class BehaviorsSharedData;
40 class SerializerElement;
77 const std::vector<gd::String>&
GetCategories()
const {
return categories; };
88 description = description_;
121 const std::vector<gd::String>&
GetAuthorIds()
const {
return authorIds; };
132 return authorUsernames;
145 isPlayableWithKeyboard = playable;
158 isPlayableWithGamepad = playable;
171 isPlayableWithMobile = playable;
183 packageName = packageName_;
195 templateSlug = templateSlug_;
209 orientation = orientation_;
245 latestCompilationDirectory = dir;
253 return latestCompilationDirectory;
261 return platformSpecificAssets;
269 return platformSpecificAssets;
301 windowHeight = height;
319 return adaptGameResolutionAtRuntime;
327 adaptGameResolutionAtRuntime = adaptGameResolutionAtRuntime_;
341 sizeOnStartupMode = mode;
407 antialiasingMode = antialiasingMode_;
414 return isAntialisingEnabledOnMobile;
421 isAntialisingEnabledOnMobile = enable;
430 return useDeprecatedZeroAsDefaultZOrder;
439 useDeprecatedZeroAsDefaultZOrder = enable;
447 return useDeprecatedZeroAsDefaultStringVariable;
455 useDeprecatedZeroAsDefaultStringVariable = enable;
462 projectUuid = projectUuid_;
474 void ResetProjectUuid();
483 return extensionProperties;
493 return extensionProperties;
504 void AddPlatform(
Platform& platform);
512 bool RemovePlatform(
const gd::String& platformName);
518 Platform& GetCurrentPlatform()
const;
525 void SetCurrentPlatform(
const gd::String& platformName);
538 areEffectsHiddenInEditor = enable;
554 std::unique_ptr<gd::Object> CreateObject(
const gd::String& type,
557 void EnsureObjectDefaultBehaviors(
gd::Object&
object)
const;
571 std::shared_ptr<gd::BaseEvent> CreateEvent(
582 bool HasLayoutNamed(
const gd::String& name)
const;
598 Layout& GetLayout(std::size_t index);
604 const Layout& GetLayout(std::size_t index)
const;
609 std::size_t GetLayoutPosition(
const gd::String& name)
const;
614 void MoveLayout(std::size_t oldIndex, std::size_t newIndex);
621 void SwapLayouts(std::size_t first, std::size_t second);
626 std::size_t GetLayoutsCount()
const;
694 bool HasExternalEventsNamed(
const gd::String& name)
const;
722 std::size_t GetExternalEventsPosition(
const gd::String& name)
const;
727 void MoveExternalEvents(std::size_t oldIndex, std::size_t newIndex);
734 void SwapExternalEvents(std::size_t first, std::size_t second);
739 std::size_t GetExternalEventsCount()
const;
746 std::size_t position);
757 std::size_t position);
762 void RemoveExternalEvents(
const gd::String& name);
788 bool HasExternalLayoutNamed(
const gd::String& name)
const;
816 std::size_t GetExternalLayoutPosition(
const gd::String& name)
const;
821 void MoveExternalLayout(std::size_t oldIndex, std::size_t newIndex);
828 void SwapExternalLayouts(std::size_t first, std::size_t second);
833 std::size_t GetExternalLayoutsCount()
const;
840 std::size_t position);
855 std::size_t position);
860 void RemoveExternalLayout(
const gd::String& name);
892 bool HasEventsFunctionsExtensionNamed(
const gd::String& name)
const;
916 std::size_t index)
const;
922 std::size_t GetEventsFunctionsExtensionPosition(
const gd::String& name)
const;
927 void MoveEventsFunctionsExtension(std::size_t oldIndex, std::size_t newIndex);
934 void SwapEventsFunctionsExtensions(std::size_t first, std::size_t second);
939 std::size_t GetEventsFunctionsExtensionsCount()
const;
946 const gd::String& name, std::size_t position);
957 std::size_t position);
966 void UnserializeAndInsertExtensionsFrom(
972 void RemoveEventsFunctionsExtension(
const gd::String& name);
977 void ClearEventsFunctionsExtensions();
982 bool HasEventsBasedObject(
const gd::String& type)
const;
998 bool HasEventsBasedBehavior(
const gd::String& type)
const;
1022 return resourcesContainer;
1036 sceneResourcesPreloading = sceneResourcesPreloading_;
1044 return sceneResourcesPreloading;
1052 sceneResourcesUnloading = sceneResourcesUnloading_;
1060 return sceneResourcesUnloading;
1107 static bool IsNameSafe(
const gd::String& name);
1117 return wholeProjectDiagnosticReport;
1132 std::unique_ptr<gd::ObjectConfiguration> CreateObjectConfiguration(
1140 unsigned int windowWidth = 0;
1141 unsigned int windowHeight = 0;
1143 unsigned int minFPS = 0;
1148 bool pixelsRounding =
false;
1150 bool adaptGameResolutionAtRuntime =
1157 bool isAntialisingEnabledOnMobile =
false;
1160 bool useDeprecatedZeroAsDefaultZOrder =
1166 bool useDeprecatedZeroAsDefaultStringVariable =
1171 std::vector<std::unique_ptr<gd::Layout> > scenes;
1174 std::vector<std::unique_ptr<gd::ExternalLayout> >
1176 std::vector<std::unique_ptr<gd::EventsFunctionsExtension> >
1177 eventsFunctionsExtensions;
1180 std::vector<gd::Platform*>
1186 std::vector<gd::String>
1188 std::vector<gd::String>
1190 std::vector<gd::String> categories;
1191 bool isPlayableWithKeyboard =
1193 bool isPlayableWithGamepad =
1195 bool isPlayableWithMobile =
false;
1201 bool folderProject =
1211 std::vector<std::unique_ptr<gd::ExternalEvents> >
1215 extensionProperties;
1221 mutable unsigned int gdMajorVersion =
1224 mutable unsigned int gdMinorVersion =
1227 mutable unsigned int gdBuildVersion =
1231 bool areEffectsHiddenInEditor =
Represents a behavior that is implemented with events.
Definition: EventsBasedBehavior.h:31
Represents an object that is implemented with events.
Definition: EventsBasedObject.h:32
Hold a list of Events Functions (gd::EventsFunction) and Events Based Behaviors.
Definition: EventsFunctionsExtension.h:42
Definition: ExtensionProperties.h:19
Contains a list of events not directly linked to a layout.
Definition: ExternalEvents.h:31
An external layout allows to create layouts of objects that can be then inserted on a layout.
Definition: ExternalLayout.h:24
Represent a layout ( also called a scene ) of a project.
Definition: Layout.h:41
Describe the content and set up of the loading screen.
Definition: LoadingScreen.h:23
A non-copyable, non-movable member object that registers/unregisters its owner with MemoryTrackedRegi...
Definition: MemoryTrackedRegistry.h:238
Represent an object of a platform.
Definition: Object.h:39
Used as a base class for classes that will own objects (see gd::Object).
Definition: ObjectsContainer.h:38
Base class representing a project (game), including all resources, scenes, objects,...
Definition: Project.h:52
unsigned int GetLastSaveGDMajorVersion()
Definition: Project.h:670
void SetUseDeprecatedZeroAsDefaultStringVariable(bool enable)
Set if the project should use "0" as the default value for unset string variables (deprecated behavio...
Definition: Project.h:454
const gd::String & GetPackageName() const
Get the project package name.
Definition: Project.h:189
const gd::String & GetSceneResourcesPreloading() const
Definition: Project.h:1043
void SetVerticalSyncActivatedByDefault(bool enable)
Definition: Project.h:376
void SetPlayableWithGamepad(bool playable=true)
Definition: Project.h:157
void SetProjectUuid(const gd::String &projectUuid_)
Change the project UUID.
Definition: Project.h:461
const gd::LoadingScreen & GetLoadingScreen() const
Return a reference to loading screen setup for the project.
Definition: Project.h:280
void SetAntialisingEnabledOnMobile(bool enable)
Definition: Project.h:420
void SetAdaptGameResolutionAtRuntime(bool adaptGameResolutionAtRuntime_)
Set if the game resolution should be adapted to the window size at runtime.
Definition: Project.h:326
const gd::TestsContainer & GetTests() const
Return a const reference to the tests of the project.
Definition: Project.h:777
const gd::String & GetPreviewLayout() const
Definition: Project.h:882
unsigned int GetGameResolutionWidth() const
Returns the default game resolution width.
Definition: Project.h:307
const gd::Watermark & GetWatermark() const
Return a reference to watermark setup for the project.
Definition: Project.h:290
const gd::String & GetSizeOnStartupMode() const
Get how the game size should be adapted to the screen.
Definition: Project.h:333
const gd::String & GetAntialiasingMode() const
Definition: Project.h:401
const gd::ExtensionProperties & GetExtensionProperties() const
Get the properties set by extensions.
Definition: Project.h:492
void SetSizeOnStartupMode(const gd::String &mode)
Set how to adapt the game size to the screen.
Definition: Project.h:340
const gd::String & GetInitialGDVersion() const
Definition: Project.h:685
bool GetPixelsRounding() const
Definition: Project.h:391
bool IsVerticalSynchronizationEnabledByDefault() const
Definition: Project.h:369
const gd::String & GetTemplateSlug() const
Get the slug of the template from which the project is created.
Definition: Project.h:201
unsigned int GetMinimumFPS() const
Definition: Project.h:364
bool IsPlayableWithGamepad() const
Definition: Project.h:164
void SetVersion(const gd::String &version_)
Change the version of the project. This can be freely set, but should follow "X.Y....
Definition: Project.h:101
unsigned int GetLastSaveGDBuildVersion()
Definition: Project.h:680
void SetSceneResourcesUnloading(gd::String sceneResourcesUnloading_)
Definition: Project.h:1051
void SetProjectFile(const gd::String &file)
Definition: Project.h:220
const std::vector< gd::String > & GetAuthorIds() const
Get the author ids of the project.
Definition: Project.h:121
bool GetAdaptGameResolutionAtRuntime() const
Returns true if the game resolution should be adapted to the window size at runtime.
Definition: Project.h:318
gd::PlatformSpecificAssets & GetPlatformSpecificAssets()
Return a reference to platform assets of the project (icons, splashscreen...).
Definition: Project.h:260
void SetGameResolutionSize(unsigned int width, unsigned int height)
Definition: Project.h:299
const ResourcesContainer & GetResourcesManager() const
Provide access to the ResourcesContainer member containing the list of the resources.
Definition: Project.h:1021
void SetPlayableWithMobile(bool playable=true)
Definition: Project.h:170
void SetFolderProject(bool enable=true)
Definition: Project.h:233
const gd::ObjectsContainer & GetObjects() const
Return the objects of the project.
Definition: Project.h:1096
const gd::String & GetLastCompilationDirectory() const
Definition: Project.h:252
void SetPlayableWithKeyboard(bool playable=true)
Definition: Project.h:144
const gd::String & GetScaleMode() const
Definition: Project.h:381
ResourcesContainer & GetResourcesManager()
Provide access to the ResourcesContainer member containing the list of the resources.
Definition: Project.h:1029
bool IsPlayableWithMobile() const
Definition: Project.h:177
void SetMinimumFPS(unsigned int minFPS_)
Definition: Project.h:359
gd::ExtensionProperties & GetExtensionProperties()
Get the properties set by extensions.
Definition: Project.h:482
const std::vector< gd::String > & GetAuthorUsernames() const
Get the author usernames of the project.
Definition: Project.h:131
const std::vector< gd::String > & GetCategories() const
Get the categories/genres of the project.
Definition: Project.h:77
void SetOrientation(const gd::String &orientation_)
Change the project orientation (in particular when exported with Cordova). This has no effect on desk...
Definition: Project.h:208
const std::vector< Platform * > & GetUsedPlatforms() const
Definition: Project.h:499
void SetEffectsHiddenInEditor(bool enable=true)
Definition: Project.h:537
const gd::String & GetSceneResourcesUnloading() const
Definition: Project.h:1059
std::vector< gd::String > & GetCategories()
Get the categories of the project, to modify them (non-const).
Definition: Project.h:82
gd::LoadingScreen & GetLoadingScreen()
Return a reference to loading screen setup for the project.
Definition: Project.h:275
bool AreEffectsHiddenInEditor() const
Definition: Project.h:530
bool IsAntialisingEnabledOnMobile() const
Definition: Project.h:413
gd::VariablesContainer & GetVariables()
Definition: Project.h:1081
gd::Watermark & GetWatermark()
Return a reference to watermark setup for the project.
Definition: Project.h:285
const gd::PlatformSpecificAssets & GetPlatformSpecificAssets() const
Return a reference to platform assets of the project (icons, splashscreen...).
Definition: Project.h:268
void SetUseDeprecatedZeroAsDefaultZOrder(bool enable)
Set if the project should set 0 as Z-order for objects created from events (which is deprecated) - in...
Definition: Project.h:438
const gd::VariablesContainer & GetVariables() const
Definition: Project.h:1073
const gd::String & GetVersion() const
Get the project version.
Definition: Project.h:106
const gd::String & GetName() const
Get the project name.
Definition: Project.h:72
int GetMaximumFPS() const
Definition: Project.h:353
void SetAuthor(const gd::String &author_)
Change the author of the project.
Definition: Project.h:111
void SetAntialiasingMode(const gd::String &antialiasingMode_)
Definition: Project.h:406
const gd::String & GetAuthor() const
Get the project author name.
Definition: Project.h:116
void SetTemplateSlug(const gd::String &templateSlug_)
Change the slug of the template from which the project is created.
Definition: Project.h:194
unsigned int GetLastSaveGDMinorVersion()
Definition: Project.h:675
bool IsPlayableWithKeyboard() const
Definition: Project.h:151
const gd::String & GetOrientation() const
Get the project orientation ("default", "landscape", "portrait").
Definition: Project.h:215
void SetPixelsRounding(bool enable)
Definition: Project.h:396
void SetMaximumFPS(int maxFPS_)
Definition: Project.h:348
void SetScaleMode(const gd::String &scaleMode_)
Definition: Project.h:386
void SetName(const gd::String &name_)
Change the project name.
Definition: Project.h:67
gd::TestsContainer & GetTests()
Return a reference to the tests of the project.
Definition: Project.h:772
void SetSceneResourcesPreloading(gd::String sceneResourcesPreloading_)
Definition: Project.h:1035
unsigned int GetGameResolutionHeight() const
Returns the default game resolution height.
Definition: Project.h:312
std::vector< gd::String > & GetAuthorIds()
Get the author ids of the project, to modify them (non-const).
Definition: Project.h:126
const gd::String & GetDescription() const
Get the project description.
Definition: Project.h:94
bool IsFolderProject() const
Definition: Project.h:239
void SetPackageName(const gd::String &packageName_)
Change the project package name.
Definition: Project.h:182
void SetFirstLayout(const gd::String &name)
Definition: Project.h:865
bool GetUseDeprecatedZeroAsDefaultStringVariable() const
Check if the project should use "0" as the default value for unset string variables (deprecated behav...
Definition: Project.h:446
const gd::String & GetProjectUuid() const
Get the project UUID, useful when using the game on online services that would require a unique ident...
Definition: Project.h:469
const gd::String & GetFirstLayout()
Definition: Project.h:870
const gd::String & GetProjectFile() const
Definition: Project.h:226
bool GetUseDeprecatedZeroAsDefaultZOrder() const
Return if the project should set 0 as Z-order for objects created from events (which is deprecated) -...
Definition: Project.h:429
void SetDescription(const gd::String &description_)
Change the project description.
Definition: Project.h:87
void SetLastCompilationDirectory(const gd::String &dir)
Definition: Project.h:244
void SetPreviewLayout(const gd::String &name)
Definition: Project.h:876
std::vector< gd::String > & GetAuthorUsernames()
Get the author usernames of the project, to modify them (non-const).
Definition: Project.h:138
gd::ObjectsContainer & GetObjects()
return the objects of the project.
Definition: Project.h:1091
Inventory all resources used by a project.
Definition: ResourcesContainer.h:628
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
A container of tests (gd::Test), used by gd::Project and gd::EventsFunctionsExtension.
Definition: TestsContainer.h:27
Class defining a container for gd::Variable.
Definition: VariablesContainer.h:29
Describe the content and set up of the watermark.
Definition: Watermark.h:23
Definition: DiagnosticReport.h:95
Definition: CommonTools.h:24