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/ResourcesManager.h"
19 #include "GDCore/Project/VariablesContainer.h"
20 #include "GDCore/Project/Watermark.h"
21 #include "GDCore/String.h"
26 class ResourcesManager;
28 class EventsFunctionsExtension;
29 class EventsBasedObject;
30 class EventsBasedBehavior;
32 class ObjectConfiguration;
33 class VariablesContainer;
34 class ArbitraryResourceWorker;
36 class BehaviorsSharedData;
38 class SerializerElement;
75 const std::vector<gd::String>&
GetCategories()
const {
return categories; };
86 description = description_;
119 const std::vector<gd::String>&
GetAuthorIds()
const {
return authorIds; };
130 return authorUsernames;
143 isPlayableWithKeyboard = playable;
156 isPlayableWithGamepad = playable;
169 isPlayableWithMobile = playable;
181 packageName = packageName_;
193 templateSlug = templateSlug_;
207 orientation = orientation_;
243 latestCompilationDirectory = dir;
251 return latestCompilationDirectory;
259 return platformSpecificAssets;
267 return platformSpecificAssets;
299 windowHeight = height;
317 return adaptGameResolutionAtRuntime;
325 adaptGameResolutionAtRuntime = adaptGameResolutionAtRuntime_;
339 sizeOnStartupMode = mode;
405 antialiasingMode = antialiasingMode_;
412 return isAntialisingEnabledOnMobile;
419 isAntialisingEnabledOnMobile = enable;
428 return useDeprecatedZeroAsDefaultZOrder;
437 useDeprecatedZeroAsDefaultZOrder = enable;
444 projectUuid = projectUuid_;
456 void ResetProjectUuid();
465 return extensionProperties;
475 return extensionProperties;
486 void AddPlatform(
Platform& platform);
494 bool RemovePlatform(
const gd::String& platformName);
500 Platform& GetCurrentPlatform()
const;
507 void SetCurrentPlatform(
const gd::String& platformName);
522 std::unique_ptr<gd::Object> CreateObject(
const gd::String& type,
525 void EnsureObjectDefaultBehaviors(
gd::Object&
object)
const;
539 std::shared_ptr<gd::BaseEvent> CreateEvent(
550 bool HasLayoutNamed(
const gd::String& name)
const;
566 Layout& GetLayout(std::size_t index);
572 const Layout& GetLayout(std::size_t index)
const;
577 std::size_t GetLayoutPosition(
const gd::String& name)
const;
582 void MoveLayout(std::size_t oldIndex, std::size_t newIndex);
589 void SwapLayouts(std::size_t first, std::size_t second);
594 std::size_t GetLayoutsCount()
const;
657 bool HasExternalEventsNamed(
const gd::String& name)
const;
685 std::size_t GetExternalEventsPosition(
const gd::String& name)
const;
690 void MoveExternalEvents(std::size_t oldIndex, std::size_t newIndex);
697 void SwapExternalEvents(std::size_t first, std::size_t second);
702 std::size_t GetExternalEventsCount()
const;
709 std::size_t position);
720 std::size_t position);
725 void RemoveExternalEvents(
const gd::String& name);
736 bool HasExternalLayoutNamed(
const gd::String& name)
const;
764 std::size_t GetExternalLayoutPosition(
const gd::String& name)
const;
769 void MoveExternalLayout(std::size_t oldIndex, std::size_t newIndex);
776 void SwapExternalLayouts(std::size_t first, std::size_t second);
781 std::size_t GetExternalLayoutsCount()
const;
788 std::size_t position);
803 std::size_t position);
808 void RemoveExternalLayout(
const gd::String& name);
828 bool HasEventsFunctionsExtensionNamed(
const gd::String& name)
const;
852 std::size_t index)
const;
858 std::size_t GetEventsFunctionsExtensionPosition(
const gd::String& name)
const;
863 void MoveEventsFunctionsExtension(std::size_t oldIndex, std::size_t newIndex);
870 void SwapEventsFunctionsExtensions(std::size_t first, std::size_t second);
875 std::size_t GetEventsFunctionsExtensionsCount()
const;
882 const gd::String& name, std::size_t position);
893 std::size_t position);
902 void UnserializeAndInsertExtensionsFrom(
908 void RemoveEventsFunctionsExtension(
const gd::String& name);
913 void ClearEventsFunctionsExtensions();
918 bool HasEventsBasedObject(
const gd::String& type)
const;
934 bool HasEventsBasedBehavior(
const gd::String& type)
const;
958 return resourcesManager;
1012 static bool IsNameSafe(
const gd::String& name);
1022 return wholeProjectDiagnosticReport;
1034 static std::vector<gd::String> GetUnserializingOrderExtensionNames(
1049 std::unique_ptr<gd::ObjectConfiguration> CreateObjectConfiguration(
1055 unsigned int windowWidth = 0;
1056 unsigned int windowHeight = 0;
1058 unsigned int minFPS = 0;
1063 bool pixelsRounding =
false;
1065 bool adaptGameResolutionAtRuntime =
1072 bool isAntialisingEnabledOnMobile =
false;
1075 bool useDeprecatedZeroAsDefaultZOrder =
1081 std::vector<std::unique_ptr<gd::Layout> > scenes;
1084 std::vector<std::unique_ptr<gd::ExternalLayout> >
1086 std::vector<std::unique_ptr<gd::EventsFunctionsExtension> >
1087 eventsFunctionsExtensions;
1090 std::vector<gd::Platform*>
1094 std::vector<gd::String>
1096 std::vector<gd::String>
1098 std::vector<gd::String> categories;
1099 bool isPlayableWithKeyboard =
1101 bool isPlayableWithGamepad =
1103 bool isPlayableWithMobile =
false;
1109 bool folderProject =
1119 std::vector<std::unique_ptr<gd::ExternalEvents> >
1122 extensionProperties;
1124 mutable unsigned int gdMajorVersion =
1127 mutable unsigned int gdMinorVersion =
1130 mutable unsigned int gdBuildVersion =
Represents a behavior that is implemented with events.
Definition: EventsBasedBehavior.h:31
Represents an object that is implemented with events.
Definition: EventsBasedObject.h:30
Hold a list of Events Functions (gd::EventsFunction) and Events Based Behaviors.
Definition: EventsFunctionsExtension.h:39
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:40
Describe the content and set up of the loading screen.
Definition: LoadingScreen.h:23
Represent an object of a platform.
Definition: Object.h:37
Used as a base class for classes that will own objects (see gd::Object).
Definition: ObjectsContainer.h:37
Base class representing a project (game), including all resources, scenes, objects,...
Definition: Project.h:50
unsigned int GetLastSaveGDMajorVersion()
Definition: Project.h:638
const gd::String & GetPackageName() const
Get the project package name.
Definition: Project.h:187
void SetVerticalSyncActivatedByDefault(bool enable)
Definition: Project.h:374
void SetPlayableWithGamepad(bool playable=true)
Definition: Project.h:155
void SetProjectUuid(const gd::String &projectUuid_)
Change the project UUID.
Definition: Project.h:443
const gd::LoadingScreen & GetLoadingScreen() const
Return a reference to loading screen setup for the project.
Definition: Project.h:278
void SetAntialisingEnabledOnMobile(bool enable)
Definition: Project.h:418
void SetAdaptGameResolutionAtRuntime(bool adaptGameResolutionAtRuntime_)
Set if the game resolution should be adapted to the window size at runtime.
Definition: Project.h:324
unsigned int GetGameResolutionWidth() const
Returns the default game resolution width.
Definition: Project.h:305
const gd::Watermark & GetWatermark() const
Return a reference to watermark setup for the project.
Definition: Project.h:288
const gd::String & GetSizeOnStartupMode() const
Get how the game size should be adapted to the screen.
Definition: Project.h:331
const gd::String & GetAntialiasingMode() const
Definition: Project.h:399
const gd::ExtensionProperties & GetExtensionProperties() const
Get the properties set by extensions.
Definition: Project.h:474
void SetSizeOnStartupMode(const gd::String &mode)
Set how to adapt the game size to the screen.
Definition: Project.h:338
bool GetPixelsRounding() const
Definition: Project.h:389
bool IsVerticalSynchronizationEnabledByDefault() const
Definition: Project.h:367
const gd::String & GetTemplateSlug() const
Get the slug of the template from which the project is created.
Definition: Project.h:199
unsigned int GetMinimumFPS() const
Definition: Project.h:362
bool IsPlayableWithGamepad() const
Definition: Project.h:162
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:99
unsigned int GetLastSaveGDBuildVersion()
Definition: Project.h:648
void SetProjectFile(const gd::String &file)
Definition: Project.h:218
const std::vector< gd::String > & GetAuthorIds() const
Get the author ids of the project.
Definition: Project.h:119
bool GetAdaptGameResolutionAtRuntime() const
Returns true if the game resolution should be adapted to the window size at runtime.
Definition: Project.h:316
gd::PlatformSpecificAssets & GetPlatformSpecificAssets()
Return a reference to platform assets of the project (icons, splashscreen...).
Definition: Project.h:258
void SetGameResolutionSize(unsigned int width, unsigned int height)
Definition: Project.h:297
void SetPlayableWithMobile(bool playable=true)
Definition: Project.h:168
void SetFolderProject(bool enable=true)
Definition: Project.h:231
const gd::ObjectsContainer & GetObjects() const
Return the objects of the project.
Definition: Project.h:1001
const gd::String & GetLastCompilationDirectory() const
Definition: Project.h:250
void SetPlayableWithKeyboard(bool playable=true)
Definition: Project.h:142
const gd::String & GetScaleMode() const
Definition: Project.h:379
bool IsPlayableWithMobile() const
Definition: Project.h:175
void SetMinimumFPS(unsigned int minFPS_)
Definition: Project.h:357
gd::ExtensionProperties & GetExtensionProperties()
Get the properties set by extensions.
Definition: Project.h:464
const std::vector< gd::String > & GetAuthorUsernames() const
Get the author usernames of the project.
Definition: Project.h:129
const std::vector< gd::String > & GetCategories() const
Get the categories/genres of the project.
Definition: Project.h:75
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:206
const std::vector< Platform * > & GetUsedPlatforms() const
Definition: Project.h:481
std::vector< gd::String > & GetCategories()
Get the categories of the project, to modify them (non-const).
Definition: Project.h:80
gd::LoadingScreen & GetLoadingScreen()
Return a reference to loading screen setup for the project.
Definition: Project.h:273
bool IsAntialisingEnabledOnMobile() const
Definition: Project.h:411
gd::VariablesContainer & GetVariables()
Definition: Project.h:986
gd::Watermark & GetWatermark()
Return a reference to watermark setup for the project.
Definition: Project.h:283
const gd::PlatformSpecificAssets & GetPlatformSpecificAssets() const
Return a reference to platform assets of the project (icons, splashscreen...).
Definition: Project.h:266
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:436
const gd::VariablesContainer & GetVariables() const
Definition: Project.h:978
const gd::String & GetVersion() const
Get the project version.
Definition: Project.h:104
const gd::String & GetName() const
Get the project name.
Definition: Project.h:70
int GetMaximumFPS() const
Definition: Project.h:351
const ResourcesManager & GetResourcesManager() const
Provide access to the ResourceManager member containing the list of the resources.
Definition: Project.h:957
ResourcesManager & GetResourcesManager()
Provide access to the ResourceManager member containing the list of the resources.
Definition: Project.h:965
void SetAuthor(const gd::String &author_)
Change the author of the project.
Definition: Project.h:109
void SetAntialiasingMode(const gd::String &antialiasingMode_)
Definition: Project.h:404
const gd::String & GetAuthor() const
Get the project author name.
Definition: Project.h:114
void SetTemplateSlug(const gd::String &templateSlug_)
Change the slug of the template from which the project is created.
Definition: Project.h:192
unsigned int GetLastSaveGDMinorVersion()
Definition: Project.h:643
bool IsPlayableWithKeyboard() const
Definition: Project.h:149
const gd::String & GetOrientation() const
Get the project orientation ("default", "landscape", "portrait").
Definition: Project.h:213
void SetPixelsRounding(bool enable)
Definition: Project.h:394
void SetMaximumFPS(int maxFPS_)
Definition: Project.h:346
void SetScaleMode(const gd::String &scaleMode_)
Definition: Project.h:384
void SetName(const gd::String &name_)
Change the project name.
Definition: Project.h:65
unsigned int GetGameResolutionHeight() const
Returns the default game resolution height.
Definition: Project.h:310
std::vector< gd::String > & GetAuthorIds()
Get the author ids of the project, to modify them (non-const).
Definition: Project.h:124
const gd::String & GetDescription() const
Get the project description.
Definition: Project.h:92
bool IsFolderProject() const
Definition: Project.h:237
void SetPackageName(const gd::String &packageName_)
Change the project package name.
Definition: Project.h:180
void SetFirstLayout(const gd::String &name)
Definition: Project.h:813
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:451
const gd::String & GetFirstLayout()
Definition: Project.h:818
const gd::String & GetProjectFile() const
Definition: Project.h:224
bool GetUseDeprecatedZeroAsDefaultZOrder() const
Return if the project should set 0 as Z-order for objects created from events (which is deprecated) -...
Definition: Project.h:427
void SetDescription(const gd::String &description_)
Change the project description.
Definition: Project.h:85
void SetLastCompilationDirectory(const gd::String &dir)
Definition: Project.h:242
std::vector< gd::String > & GetAuthorUsernames()
Get the author usernames of the project, to modify them (non-const).
Definition: Project.h:136
gd::ObjectsContainer & GetObjects()
return the objects of the project.
Definition: Project.h:996
Inventory all resources used by a project.
Definition: ResourcesManager.h:582
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
Describe the content and set up of the watermark.
Definition: Watermark.h:23
Definition: DiagnosticReport.h:95
Definition: CommonTools.h:24