7 #ifndef GDCORE_PROJECT_H
8 #define GDCORE_PROJECT_H
12 #include "GDCore/Project/ExtensionProperties.h"
13 #include "GDCore/Project/LoadingScreen.h"
14 #include "GDCore/Project/ObjectGroupsContainer.h"
15 #include "GDCore/Project/ObjectsContainer.h"
16 #include "GDCore/Project/PlatformSpecificAssets.h"
17 #include "GDCore/Project/ResourcesManager.h"
18 #include "GDCore/Project/VariablesContainer.h"
19 #include "GDCore/Project/Watermark.h"
20 #include "GDCore/String.h"
25 class ResourcesManager;
27 class EventsFunctionsExtension;
28 class EventsBasedObject;
29 class EventsBasedBehavior;
31 class ObjectConfiguration;
32 class VariablesContainer;
33 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,
530 std::unique_ptr<gd::ObjectConfiguration> CreateObjectConfiguration(
545 std::shared_ptr<gd::BaseEvent> CreateEvent(
556 bool HasLayoutNamed(
const gd::String& name)
const;
572 Layout& GetLayout(std::size_t index);
578 const Layout& GetLayout(std::size_t index)
const;
583 std::size_t GetLayoutPosition(
const gd::String& name)
const;
588 void MoveLayout(std::size_t oldIndex, std::size_t newIndex);
595 void SwapLayouts(std::size_t first, std::size_t second);
600 std::size_t GetLayoutsCount()
const;
663 bool HasExternalEventsNamed(
const gd::String& name)
const;
691 std::size_t GetExternalEventsPosition(
const gd::String& name)
const;
696 void MoveExternalEvents(std::size_t oldIndex, std::size_t newIndex);
703 void SwapExternalEvents(std::size_t first, std::size_t second);
708 std::size_t GetExternalEventsCount()
const;
715 std::size_t position);
726 std::size_t position);
731 void RemoveExternalEvents(
const gd::String& name);
742 bool HasExternalLayoutNamed(
const gd::String& name)
const;
770 std::size_t GetExternalLayoutPosition(
const gd::String& name)
const;
775 void MoveExternalLayout(std::size_t oldIndex, std::size_t newIndex);
782 void SwapExternalLayouts(std::size_t first, std::size_t second);
787 std::size_t GetExternalLayoutsCount()
const;
794 std::size_t position);
809 std::size_t position);
814 void RemoveExternalLayout(
const gd::String& name);
834 bool HasEventsFunctionsExtensionNamed(
const gd::String& name)
const;
858 std::size_t index)
const;
864 std::size_t GetEventsFunctionsExtensionPosition(
const gd::String& name)
const;
869 void MoveEventsFunctionsExtension(std::size_t oldIndex, std::size_t newIndex);
876 void SwapEventsFunctionsExtensions(std::size_t first, std::size_t second);
881 std::size_t GetEventsFunctionsExtensionsCount()
const;
888 const gd::String& name, std::size_t position);
899 std::size_t position);
904 void RemoveEventsFunctionsExtension(
const gd::String& name);
909 void ClearEventsFunctionsExtensions();
914 bool HasEventsBasedObject(
const gd::String& type)
const;
930 bool HasEventsBasedBehavior(
const gd::String& type)
const;
954 return resourcesManager;
994 static bool IsNameSafe(
const gd::String& name);
1018 return externalSourceFiles;
1042 void RemoveSourceFile(
const gd::String& name);
1050 std::size_t position = -1);
1063 unsigned int windowWidth;
1064 unsigned int windowHeight;
1066 unsigned int minFPS;
1070 bool pixelsRounding;
1072 bool adaptGameResolutionAtRuntime;
1078 bool isAntialisingEnabledOnMobile;
1081 bool useDeprecatedZeroAsDefaultZOrder;
1086 std::vector<std::unique_ptr<gd::Layout> > scenes;
1088 std::vector<std::unique_ptr<gd::ExternalLayout> >
1090 std::vector<std::unique_ptr<gd::EventsFunctionsExtension> >
1091 eventsFunctionsExtensions;
1094 std::vector<gd::Platform*>
1097 bool useExternalSourceFiles;
1098 std::vector<std::unique_ptr<gd::SourceFile> >
1099 externalSourceFiles;
1101 std::vector<gd::String>
1103 std::vector<gd::String>
1105 std::vector<gd::String> categories;
1106 bool isPlayableWithKeyboard;
1107 bool isPlayableWithGamepad;
1108 bool isPlayableWithMobile;
1124 std::vector<std::unique_ptr<gd::ExternalEvents> >
1127 extensionProperties;
1128 mutable unsigned int gdMajorVersion;
1130 mutable unsigned int gdMinorVersion;
1132 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:29
Hold a list of Events Functions (gd::EventsFunction) and Events Based Behaviors.
Definition: EventsFunctionsExtension.h:38
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:39
Describe the content and set up of the loading screen.
Definition: LoadingScreen.h:23
Used as a base class for classes that will own objects (see gd::Object).
Definition: ObjectsContainer.h:36
Base class representing a project (game), including all resources, scenes, objects,...
Definition: Project.h:50
unsigned int GetLastSaveGDMajorVersion()
Definition: Project.h:644
const gd::String & GetPackageName() const
Get the project package name.
Definition: Project.h:187
const std::vector< std::unique_ptr< gd::SourceFile > > & GetAllSourceFiles() const
Return a const reference to the vector containing all the source files used by the game.
Definition: Project.h:1016
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:654
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::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:982
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:974
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:953
ResourcesManager & GetResourcesManager()
Provide access to the ResourceManager member containing the list of the resources.
Definition: Project.h:961
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:649
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
bool UseExternalSourceFiles() const
Return true if the game activated the use of external source files.
Definition: Project.h:1010
void SetFirstLayout(const gd::String &name)
Definition: Project.h:819
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:824
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
Inventory all resources used by a project.
Definition: ResourcesManager.h:557
A generic container that can represent a value ( containing a string, double, bool or int),...
Definition: SerializerElement.h:37
Represents a "physical" source file.
Definition: SourceFile.h:25
String represents an UTF8 encoded string.
Definition: String.h:31
Class defining a container for gd::Variable.
Definition: VariablesContainer.h:30
Describe the content and set up of the watermark.
Definition: Watermark.h:23
Definition: CommonTools.h:24