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/VariablesContainer.h"
20 #include "GDCore/Project/Watermark.h"
21 #include "GDCore/Project/MemoryTrackedRegistry.h"
22 #include "GDCore/String.h"
27 class ResourcesContainer;
29 class EventsFunctionsExtension;
30 class EventsBasedObject;
31 class EventsBasedBehavior;
33 class ObjectConfiguration;
34 class VariablesContainer;
35 class ArbitraryResourceWorker;
37 class BehaviorsSharedData;
39 class SerializerElement;
76 const std::vector<gd::String>&
GetCategories()
const {
return categories; };
87 description = description_;
120 const std::vector<gd::String>&
GetAuthorIds()
const {
return authorIds; };
131 return authorUsernames;
144 isPlayableWithKeyboard = playable;
157 isPlayableWithGamepad = playable;
170 isPlayableWithMobile = playable;
182 packageName = packageName_;
194 templateSlug = templateSlug_;
208 orientation = orientation_;
244 latestCompilationDirectory = dir;
252 return latestCompilationDirectory;
260 return platformSpecificAssets;
268 return platformSpecificAssets;
300 windowHeight = height;
318 return adaptGameResolutionAtRuntime;
326 adaptGameResolutionAtRuntime = adaptGameResolutionAtRuntime_;
340 sizeOnStartupMode = mode;
406 antialiasingMode = antialiasingMode_;
413 return isAntialisingEnabledOnMobile;
420 isAntialisingEnabledOnMobile = enable;
429 return useDeprecatedZeroAsDefaultZOrder;
438 useDeprecatedZeroAsDefaultZOrder = enable;
445 projectUuid = projectUuid_;
457 void ResetProjectUuid();
466 return extensionProperties;
476 return extensionProperties;
487 void AddPlatform(
Platform& platform);
495 bool RemovePlatform(
const gd::String& platformName);
501 Platform& GetCurrentPlatform()
const;
508 void SetCurrentPlatform(
const gd::String& platformName);
521 areEffectsHiddenInEditor = enable;
537 std::unique_ptr<gd::Object> CreateObject(
const gd::String& type,
540 void EnsureObjectDefaultBehaviors(
gd::Object&
object)
const;
554 std::shared_ptr<gd::BaseEvent> CreateEvent(
565 bool HasLayoutNamed(
const gd::String& name)
const;
581 Layout& GetLayout(std::size_t index);
587 const Layout& GetLayout(std::size_t index)
const;
592 std::size_t GetLayoutPosition(
const gd::String& name)
const;
597 void MoveLayout(std::size_t oldIndex, std::size_t newIndex);
604 void SwapLayouts(std::size_t first, std::size_t second);
609 std::size_t GetLayoutsCount()
const;
672 bool HasExternalEventsNamed(
const gd::String& name)
const;
700 std::size_t GetExternalEventsPosition(
const gd::String& name)
const;
705 void MoveExternalEvents(std::size_t oldIndex, std::size_t newIndex);
712 void SwapExternalEvents(std::size_t first, std::size_t second);
717 std::size_t GetExternalEventsCount()
const;
724 std::size_t position);
735 std::size_t position);
740 void RemoveExternalEvents(
const gd::String& name);
751 bool HasExternalLayoutNamed(
const gd::String& name)
const;
779 std::size_t GetExternalLayoutPosition(
const gd::String& name)
const;
784 void MoveExternalLayout(std::size_t oldIndex, std::size_t newIndex);
791 void SwapExternalLayouts(std::size_t first, std::size_t second);
796 std::size_t GetExternalLayoutsCount()
const;
803 std::size_t position);
818 std::size_t position);
823 void RemoveExternalLayout(
const gd::String& name);
843 bool HasEventsFunctionsExtensionNamed(
const gd::String& name)
const;
867 std::size_t index)
const;
873 std::size_t GetEventsFunctionsExtensionPosition(
const gd::String& name)
const;
878 void MoveEventsFunctionsExtension(std::size_t oldIndex, std::size_t newIndex);
885 void SwapEventsFunctionsExtensions(std::size_t first, std::size_t second);
890 std::size_t GetEventsFunctionsExtensionsCount()
const;
897 const gd::String& name, std::size_t position);
908 std::size_t position);
917 void UnserializeAndInsertExtensionsFrom(
923 void RemoveEventsFunctionsExtension(
const gd::String& name);
928 void ClearEventsFunctionsExtensions();
933 bool HasEventsBasedObject(
const gd::String& type)
const;
949 bool HasEventsBasedBehavior(
const gd::String& type)
const;
973 return resourcesContainer;
987 sceneResourcesPreloading = sceneResourcesPreloading_;
995 return sceneResourcesPreloading;
1003 sceneResourcesUnloading = sceneResourcesUnloading_;
1011 return sceneResourcesUnloading;
1058 static bool IsNameSafe(
const gd::String& name);
1068 return wholeProjectDiagnosticReport;
1080 static std::vector<gd::String> GetUnserializingOrderExtensionNames(
1095 std::unique_ptr<gd::ObjectConfiguration> CreateObjectConfiguration(
1103 unsigned int windowWidth = 0;
1104 unsigned int windowHeight = 0;
1106 unsigned int minFPS = 0;
1111 bool pixelsRounding =
false;
1113 bool adaptGameResolutionAtRuntime =
1120 bool isAntialisingEnabledOnMobile =
false;
1123 bool useDeprecatedZeroAsDefaultZOrder =
1129 std::vector<std::unique_ptr<gd::Layout> > scenes;
1132 std::vector<std::unique_ptr<gd::ExternalLayout> >
1134 std::vector<std::unique_ptr<gd::EventsFunctionsExtension> >
1135 eventsFunctionsExtensions;
1138 std::vector<gd::Platform*>
1142 std::vector<gd::String>
1144 std::vector<gd::String>
1146 std::vector<gd::String> categories;
1147 bool isPlayableWithKeyboard =
1149 bool isPlayableWithGamepad =
1151 bool isPlayableWithMobile =
false;
1157 bool folderProject =
1167 std::vector<std::unique_ptr<gd::ExternalEvents> >
1170 extensionProperties;
1176 mutable unsigned int gdMajorVersion =
1179 mutable unsigned int gdMinorVersion =
1182 mutable unsigned int gdBuildVersion =
1185 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:41
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:51
unsigned int GetLastSaveGDMajorVersion()
Definition: Project.h:653
const gd::String & GetPackageName() const
Get the project package name.
Definition: Project.h:188
const gd::String & GetSceneResourcesPreloading() const
Definition: Project.h:994
void SetVerticalSyncActivatedByDefault(bool enable)
Definition: Project.h:375
void SetPlayableWithGamepad(bool playable=true)
Definition: Project.h:156
void SetProjectUuid(const gd::String &projectUuid_)
Change the project UUID.
Definition: Project.h:444
const gd::LoadingScreen & GetLoadingScreen() const
Return a reference to loading screen setup for the project.
Definition: Project.h:279
void SetAntialisingEnabledOnMobile(bool enable)
Definition: Project.h:419
void SetAdaptGameResolutionAtRuntime(bool adaptGameResolutionAtRuntime_)
Set if the game resolution should be adapted to the window size at runtime.
Definition: Project.h:325
unsigned int GetGameResolutionWidth() const
Returns the default game resolution width.
Definition: Project.h:306
const gd::Watermark & GetWatermark() const
Return a reference to watermark setup for the project.
Definition: Project.h:289
const gd::String & GetSizeOnStartupMode() const
Get how the game size should be adapted to the screen.
Definition: Project.h:332
const gd::String & GetAntialiasingMode() const
Definition: Project.h:400
const gd::ExtensionProperties & GetExtensionProperties() const
Get the properties set by extensions.
Definition: Project.h:475
void SetSizeOnStartupMode(const gd::String &mode)
Set how to adapt the game size to the screen.
Definition: Project.h:339
bool GetPixelsRounding() const
Definition: Project.h:390
bool IsVerticalSynchronizationEnabledByDefault() const
Definition: Project.h:368
const gd::String & GetTemplateSlug() const
Get the slug of the template from which the project is created.
Definition: Project.h:200
unsigned int GetMinimumFPS() const
Definition: Project.h:363
bool IsPlayableWithGamepad() const
Definition: Project.h:163
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:100
unsigned int GetLastSaveGDBuildVersion()
Definition: Project.h:663
void SetSceneResourcesUnloading(gd::String sceneResourcesUnloading_)
Definition: Project.h:1002
void SetProjectFile(const gd::String &file)
Definition: Project.h:219
const std::vector< gd::String > & GetAuthorIds() const
Get the author ids of the project.
Definition: Project.h:120
bool GetAdaptGameResolutionAtRuntime() const
Returns true if the game resolution should be adapted to the window size at runtime.
Definition: Project.h:317
gd::PlatformSpecificAssets & GetPlatformSpecificAssets()
Return a reference to platform assets of the project (icons, splashscreen...).
Definition: Project.h:259
void SetGameResolutionSize(unsigned int width, unsigned int height)
Definition: Project.h:298
const ResourcesContainer & GetResourcesManager() const
Provide access to the ResourcesContainer member containing the list of the resources.
Definition: Project.h:972
void SetPlayableWithMobile(bool playable=true)
Definition: Project.h:169
void SetFolderProject(bool enable=true)
Definition: Project.h:232
const gd::ObjectsContainer & GetObjects() const
Return the objects of the project.
Definition: Project.h:1047
const gd::String & GetLastCompilationDirectory() const
Definition: Project.h:251
void SetPlayableWithKeyboard(bool playable=true)
Definition: Project.h:143
const gd::String & GetScaleMode() const
Definition: Project.h:380
ResourcesContainer & GetResourcesManager()
Provide access to the ResourcesContainer member containing the list of the resources.
Definition: Project.h:980
bool IsPlayableWithMobile() const
Definition: Project.h:176
void SetMinimumFPS(unsigned int minFPS_)
Definition: Project.h:358
gd::ExtensionProperties & GetExtensionProperties()
Get the properties set by extensions.
Definition: Project.h:465
const std::vector< gd::String > & GetAuthorUsernames() const
Get the author usernames of the project.
Definition: Project.h:130
const std::vector< gd::String > & GetCategories() const
Get the categories/genres of the project.
Definition: Project.h:76
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:207
const std::vector< Platform * > & GetUsedPlatforms() const
Definition: Project.h:482
void SetEffectsHiddenInEditor(bool enable=true)
Definition: Project.h:520
const gd::String & GetSceneResourcesUnloading() const
Definition: Project.h:1010
std::vector< gd::String > & GetCategories()
Get the categories of the project, to modify them (non-const).
Definition: Project.h:81
gd::LoadingScreen & GetLoadingScreen()
Return a reference to loading screen setup for the project.
Definition: Project.h:274
bool AreEffectsHiddenInEditor() const
Definition: Project.h:513
bool IsAntialisingEnabledOnMobile() const
Definition: Project.h:412
gd::VariablesContainer & GetVariables()
Definition: Project.h:1032
gd::Watermark & GetWatermark()
Return a reference to watermark setup for the project.
Definition: Project.h:284
const gd::PlatformSpecificAssets & GetPlatformSpecificAssets() const
Return a reference to platform assets of the project (icons, splashscreen...).
Definition: Project.h:267
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:437
const gd::VariablesContainer & GetVariables() const
Definition: Project.h:1024
const gd::String & GetVersion() const
Get the project version.
Definition: Project.h:105
const gd::String & GetName() const
Get the project name.
Definition: Project.h:71
int GetMaximumFPS() const
Definition: Project.h:352
void SetAuthor(const gd::String &author_)
Change the author of the project.
Definition: Project.h:110
void SetAntialiasingMode(const gd::String &antialiasingMode_)
Definition: Project.h:405
const gd::String & GetAuthor() const
Get the project author name.
Definition: Project.h:115
void SetTemplateSlug(const gd::String &templateSlug_)
Change the slug of the template from which the project is created.
Definition: Project.h:193
unsigned int GetLastSaveGDMinorVersion()
Definition: Project.h:658
bool IsPlayableWithKeyboard() const
Definition: Project.h:150
const gd::String & GetOrientation() const
Get the project orientation ("default", "landscape", "portrait").
Definition: Project.h:214
void SetPixelsRounding(bool enable)
Definition: Project.h:395
void SetMaximumFPS(int maxFPS_)
Definition: Project.h:347
void SetScaleMode(const gd::String &scaleMode_)
Definition: Project.h:385
void SetName(const gd::String &name_)
Change the project name.
Definition: Project.h:66
void SetSceneResourcesPreloading(gd::String sceneResourcesPreloading_)
Definition: Project.h:986
unsigned int GetGameResolutionHeight() const
Returns the default game resolution height.
Definition: Project.h:311
std::vector< gd::String > & GetAuthorIds()
Get the author ids of the project, to modify them (non-const).
Definition: Project.h:125
const gd::String & GetDescription() const
Get the project description.
Definition: Project.h:93
bool IsFolderProject() const
Definition: Project.h:238
void SetPackageName(const gd::String &packageName_)
Change the project package name.
Definition: Project.h:181
void SetFirstLayout(const gd::String &name)
Definition: Project.h:828
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:452
const gd::String & GetFirstLayout()
Definition: Project.h:833
const gd::String & GetProjectFile() const
Definition: Project.h:225
bool GetUseDeprecatedZeroAsDefaultZOrder() const
Return if the project should set 0 as Z-order for objects created from events (which is deprecated) -...
Definition: Project.h:428
void SetDescription(const gd::String &description_)
Change the project description.
Definition: Project.h:86
void SetLastCompilationDirectory(const gd::String &dir)
Definition: Project.h:243
std::vector< gd::String > & GetAuthorUsernames()
Get the author usernames of the project, to modify them (non-const).
Definition: Project.h:137
gd::ObjectsContainer & GetObjects()
return the objects of the project.
Definition: Project.h:1042
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
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