Potato Engine
Loading...
Searching...
No Matches
World Class Reference

Local level managing gameplay interactions. More...

#include <World.hpp>

Public Member Functions

template<typename ActorClass>
ActorClass * SpawnActor ()
 Spawns Actor into world.
template<typename ActorClass>
ActorClass * SpawnActor (const Vector2 &SpawnPosition)
 Spawns Actor into world.
void DestroyActor (Actor *actor)
 Destroys actor from world.
ActorAddtoPool (Actor *actor)
 Attempts to add external actor object to world managing system.
size_t ActorCount () const
 Gets count of actors in world.
const ActorPoolGetAllActors () const
 Gets ActorPool.

Static Public Attributes

static constexpr int EXTENT_X = 1'000
 x-width of game world
static constexpr int EXTENT_Y = 24
 y-height of game world

Detailed Description

Local level managing gameplay interactions.

Definition at line 18 of file World.hpp.

Constructor & Destructor Documentation

◆ World()

World::World ( )

Definition at line 8 of file World.cpp.

◆ ~World()

World::~World ( )

Definition at line 12 of file World.cpp.

Member Function Documentation

◆ SpawnActor() [1/2]

template<typename ActorClass>
ActorClass * World::SpawnActor ( )

Spawns Actor into world.

  • Template Parameters
    ActorClassClass of actor to spawn
    Returns
    Actor added to world

Definition at line 74 of file World.hpp.

◆ SpawnActor() [2/2]

template<typename ActorClass>
ActorClass * World::SpawnActor ( const Vector2 & SpawnPosition)

Spawns Actor into world.

  • Template Parameters
    ActorClassClass of actor to spawn
    Parameters
    SpawnPositionDefault world position for actor to be spawned at
    Returns
    Actor added to world

Definition at line 87 of file World.hpp.

◆ DestroyActor()

void World::DestroyActor ( Actor * actor)

Destroys actor from world.

Parameters
actorActor to destroy

Definition at line 23 of file World.cpp.

◆ AddtoPool()

Actor * World::AddtoPool ( Actor * actor)

Attempts to add external actor object to world managing system.

Warning
Intended for internal use only. Always prefer spawning using regular logic.
See also
SpawnActor
Returns
actor if successful

Definition at line 37 of file World.cpp.

◆ ActorCount()

size_t World::ActorCount ( ) const
inline

Gets count of actors in world.

Returns
Count

Definition at line 63 of file World.hpp.

◆ GetAllActors()

const ActorPool & World::GetAllActors ( ) const

Gets ActorPool.

Returns
actor pool

Definition at line 32 of file World.cpp.

Member Data Documentation

◆ EXTENT_X

int World::EXTENT_X = 1'000
staticconstexpr

x-width of game world

Definition at line 22 of file World.hpp.

◆ EXTENT_Y

int World::EXTENT_Y = 24
staticconstexpr

y-height of game world

Definition at line 24 of file World.hpp.