HeadBall  1.0
A game
Public Member Functions | Private Attributes | List of all members
HeadBall::TimeManager Class Reference

The class that manages the game time. More...

#include <TimeManager.hpp>

Collaboration diagram for HeadBall::TimeManager:
Collaboration graph

Public Member Functions

 TimeManager ()
 Construct a new Time Manager object. More...
 
 ~TimeManager ()
 Destroy the Time Manager object. More...
 
void processTime ()
 Process the time in the game. More...
 
std::string displayTimer ()
 Return the game time as a string that can simply be displayed. More...
 
int getTime ()
 Get the time in minutes as an integer. More...
 
void resetTimer ()
 Reset the clock. More...
 
void pause ()
 Pause the timer. More...
 
void resume ()
 Resume the paused timer. More...
 
void setTime (sf::Time timer)
 Set the Time. More...
 
void zero ()
 Set the time as zero. More...
 

Private Attributes

sf::Clock _clock
 The clock for getting the current time. More...
 
sf::Time T
 The Game time. More...
 
sf::Time tempTime
 The temporary object used for storing time while paused, goal scored or during half time. More...
 
std::stringstream ss
 The string stream used for returning the game time as a string. More...
 
int t
 
int vt
 
int s
 
int m
 

Detailed Description

The class that manages the game time.

Constructor & Destructor Documentation

◆ TimeManager()

HeadBall::TimeManager::TimeManager ( )

Construct a new Time Manager object.

◆ ~TimeManager()

HeadBall::TimeManager::~TimeManager ( )
inline

Destroy the Time Manager object.

Member Function Documentation

◆ displayTimer()

std::string HeadBall::TimeManager::displayTimer ( )

Return the game time as a string that can simply be displayed.

Returns
std::string The game time as a sttring

◆ getTime()

int HeadBall::TimeManager::getTime ( )

Get the time in minutes as an integer.

Returns
int The game time in minutes

◆ pause()

void HeadBall::TimeManager::pause ( )

Pause the timer.

◆ processTime()

void HeadBall::TimeManager::processTime ( )

Process the time in the game.

◆ resetTimer()

void HeadBall::TimeManager::resetTimer ( )

Reset the clock.

◆ resume()

void HeadBall::TimeManager::resume ( )

Resume the paused timer.

◆ setTime()

void HeadBall::TimeManager::setTime ( sf::Time  timer)

Set the Time.

Parameters
timerThe time as sf::Time

◆ zero()

void HeadBall::TimeManager::zero ( )

Set the time as zero.

Member Data Documentation

◆ _clock

sf::Clock HeadBall::TimeManager::_clock
private

The clock for getting the current time.

◆ m

int HeadBall::TimeManager::m
private

◆ s

int HeadBall::TimeManager::s
private

◆ ss

std::stringstream HeadBall::TimeManager::ss
private

The string stream used for returning the game time as a string.

◆ T

sf::Time HeadBall::TimeManager::T
private

The Game time.

◆ t

int HeadBall::TimeManager::t
private

◆ tempTime

sf::Time HeadBall::TimeManager::tempTime
private

The temporary object used for storing time while paused, goal scored or during half time.

◆ vt

int HeadBall::TimeManager::vt
private

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