Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cpp-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Maul
cpp-project
Merge requests
!54
Add many doxygen comments
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Add many doxygen comments
doxygen
into
main
Overview
0
Commits
1
Pipelines
0
Changes
15
Merged
Frederik Alexander Keens
requested to merge
doxygen
into
main
5 months ago
Overview
0
Commits
1
Pipelines
0
Changes
15
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
12c5dfd1
1 commit,
5 months ago
15 files
+
673
−
123
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
15
src/game/core/Engine.hpp
+
75
−
9
View file @ 12c5dfd1
Edit in single-file editor
Open in Web IDE
Show full file
@@ -32,35 +32,101 @@ class Config;
class
Engine
{
public:
/**
* Constructor
*
* @param window The window to use as main window and render
*/
Engine
(
Window
&
window
);
Engine
(
const
Engine
&
)
=
delete
;
Engine
&
operator
=
(
const
Engine
&
)
=
delete
;
/**
* Returns the state of the engine.
*
* @return true when running, false when exited
*/
bool
exited
();
/**
* Shut down the engine.
*/
void
exit
();
/**
* Handles the events of the current frame.
*
* Will give the event handler of the current scene every SDL event that occured.
* If the engines scene dequeue was modified since the last pump cycle this will also change
* the current scene.
*/
void
pump
();
/**
* Push a scene into the scene dequeue.
*
* @param A shared pointer to the scene to push
*/
void
pushScene
(
std
::
shared_ptr
<
Scene
>
scene
);
/**
* Pops a scene from the scene dequeue.
*
* @return The scene that got removed
*/
std
::
optional
<
std
::
shared_ptr
<
Scene
>>
popScene
();
/**
* Changes the scene to the main menu.
*/
void
returnToMenu
();
/**
* Gets the queue of SDL events that occured.
*
* @return The dequeue of SDL events
*/
std
::
deque
<
SDL_Event
>&
events
();
/**
* Sets this engines Spritesheet.
*
* @param spritesheet The spritesheet
*/
void
setSpritesheet
(
Spritesheet
&
spritesheet
);
/**
* Gets the current Spritesheet.
*
* @return The Spritesheet
*/
Spritesheet
*
getSpritesheet
();
/**
* Gets the current stage of the engine.
*
* @return The stage
*/
int
getStage
();
/**
* Gets the unit config.
*
* @return The config
*/
Config
&
getUnitConfig
();
/**
* Render the current scene.
*/
void
render
();
/**
* Gets the rendering context of the engine.Building
*
* @return The SDL renderer
*/
SDL_Renderer
*
renderer
();
void
startGame
(
const
std
::
string
&
levelPath
);
@@ -70,17 +136,17 @@ class Engine
~
Engine
();
private:
Window
&
m_window
;
SDL_Renderer
*
m_SDLRenderer
;
std
::
vector
<
std
::
shared_ptr
<
Scene
>>
m_scenes
;
std
::
optional
<
Spritesheet
*>
m_spritesheet
;
std
::
deque
<
SDL_Event
>
m_events
;
Window
&
m_window
;
// The main window
SDL_Renderer
*
m_SDLRenderer
;
// The rendering context
std
::
vector
<
std
::
shared_ptr
<
Scene
>>
m_scenes
;
// The scene dequeue
std
::
optional
<
Spritesheet
*>
m_spritesheet
;
// The current Spritesheet
std
::
deque
<
SDL_Event
>
m_events
;
// The SDL events that occured since the last pump
bool
m_quit
;
int
m_stage
;
bool
m_quit
;
// Flag for quitting the engine
int
m_stage
;
// The stage for animation purposes
Config
m_unitConfig
;
std
::
unique_ptr
<
GameManager
>
m_gameManager
;
Config
m_unitConfig
;
// Config with unit stats
std
::
unique_ptr
<
GameManager
>
m_gameManager
;
// The game manager
};
}
// namespace advanced_wars
Loading