Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
main.cpp File Reference

Tutorial for the EngineSquared core lifecycle. The application runs through three phases: More...

#include "Engine.hpp"

Classes

struct  Example::Resource::DirectorResource
 Simulates a unique director resource shared by all systems. More...
struct  Example::Component::Name
 Display name assigned to an entity. More...
struct  Example::Component::WorkTime
 Tracks how many hours an entity has worked. The component is removed from the entity once maxHours is reached. More...
class  Example::System::DirectorMonitor
 Logs the director's monitoring activity each tick. More...
class  Example::System::WorkHoursUpdate
 Increments work hours for each entity. Removes the WorkTime component when the maximum is reached. More...
class  Example::App

Namespaces

namespace  Example
namespace  Example::Resource
 Holds unique data shared across the entire application.
namespace  Example::Component
namespace  Example::System

Functions

void Example::System::Hello (Engine::Core &core)
 Logs a greeting message for each entity carrying a Name component.
void Example::System::Close (Engine::Core &core)
 Stops the core loop when no entity carries a WorkTime component anymore.
void Example::System::Working (Engine::Core &core)
 Logs a working message for each entity still carrying a WorkTime component.
void Example::System::Goodbye (Engine::Core &core)
 Logs a shutdown message once all entities have left.
int main (void)

Detailed Description

Tutorial for the EngineSquared core lifecycle. The application runs through three phases:

  • Startup: entities and resources are created, teachers arrive.
  • Update: teachers work each tick until their hours are exhausted, then leave. The director monitors activities but may be absent for meetings.
  • Shutdown: the school closes once all teachers have left.

Function Documentation

◆ main()

int main ( void )

Run until System::Close calls core.Stop().