Bridges-C++  3.4.2
Bridges(C++ API)
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
bridges::game::GameBase3D Class Referenceabstract

#include <GameBase3D.h>

Inheritance diagram for bridges::game::GameBase3D:
bridges::game::NonBlockingGame3D

Detailed Description

This class extends the GameBase class to 3D environments.

This class forms the infrastructure for the BRIDGES Game API and contains methods for input listener and drawing functions and attributes

Author
Kalpathi Subramanian, Matthew Mcquaigue
Date
9/27/22

Public Member Functions

void addScene (Scene &sc)
 
Scene getCurrentScene ()
 
bool gameover () const
 

Public Attributes

Scene current_scene
 

Protected Member Functions

 GameBase3D (int assignmentID, std::string username, std::string apikey)
 Protected construction prevens direct creation. More...
 
virtual ~GameBase3D ()=default
 
virtual void initialize ()=0
 This function is called once when the game starts. More...
 
virtual void gameLoop ()=0
 This function is called once per frame of the game. More...
 
void registerKeyListener (KeypressListener *p)
 register a new KeypressListener More...
 
void render ()
 Renders the game. More...
 
void quit ()
 calling this function causes the game to end. More...
 
void setTitle (std::string title)
 Set the title of the game. More...
 
void setDescription (std::string desc)
 Set a short description of the game. More...
 

Protected Attributes

bool debug = false
 

Constructor & Destructor Documentation

◆ GameBase3D()

bridges::game::GameBase3D::GameBase3D ( int  assignmentID,
std::string  username,
std::string  apikey 
)
inlineprotected

Protected construction prevens direct creation.

Having a protected constructor prevents the object from being directly created. Since GameBase is meant to be a purely internal class, that seems appropriate.

◆ ~GameBase3D()

virtual bridges::game::GameBase3D::~GameBase3D ( )
protectedvirtualdefault

Member Function Documentation

◆ addScene()

void bridges::game::GameBase3D::addScene ( Scene sc)
inline

◆ gameLoop()

virtual void bridges::game::GameBase3D::gameLoop ( )
protectedpure virtual

This function is called once per frame of the game.

Students write this function. It will be called at each frame of the game.

◆ gameover()

bool bridges::game::GameBase3D::gameover ( ) const
inline

◆ getCurrentScene()

Scene bridges::game::GameBase3D::getCurrentScene ( )
inline

◆ initialize()

virtual void bridges::game::GameBase3D::initialize ( )
protectedpure virtual

This function is called once when the game starts.

Students write this function. It will be called once at the begining of the game.

◆ quit()

void bridges::game::GameBase3D::quit ( )
inlineprotected

calling this function causes the game to end.

That is to say, the current frame will be the last frame of the game.

◆ registerKeyListener()

void bridges::game::GameBase3D::registerKeyListener ( KeypressListener p)
inlineprotected

register a new KeypressListener

Students should not have to call this function directly. The KeypressListener listener will get notified of all keypresses (up and down) that happens in the game.

Parameters
pa KeypressListener to register

◆ render()

void bridges::game::GameBase3D::render ( )
inlineprotected

Renders the game.

Student should not have to call this function directly. It is called automatically by Bridges.

◆ setDescription()

void bridges::game::GameBase3D::setDescription ( std::string  desc)
inlineprotected

Set a short description of the game.

Parameters
descDescription of the game

◆ setTitle()

void bridges::game::GameBase3D::setTitle ( std::string  title)
inlineprotected

Set the title of the game.

Parameters
titleTitle of the game

Member Data Documentation

◆ current_scene

Scene bridges::game::GameBase3D::current_scene

◆ debug

bool bridges::game::GameBase3D::debug = false
protected

The documentation for this class was generated from the following file: