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

Derived class of State class with visibility mode public that checks whether the player has scored goal or not and updates the state. More...

#include <GoalState.hpp>

Inheritance diagram for HeadBall::GoalState:
Inheritance graph
Collaboration diagram for HeadBall::GoalState:
Collaboration graph

Public Member Functions

 GoalState (GameDataRef data, ScoreTimeRef scoretime, bool isSecondHalf)
 Construct a new Goal State object. More...
 
void init ()
 Initialze a new GoalState object. More...
 
void handleInput ()
 Handles all the input during goalstate. More...
 
void update ()
 Updates the rendering window as per the provided inputs. More...
 
void draw ()
 Draws all the SFML objects of Goal state. More...
 
virtual void pause ()
 Virtual function for pausing the state. More...
 
virtual void resume ()
 Virtual function for resuming the object. More...
 
virtual void animate ()
 Vitrual function for performing animations. More...
 

Private Attributes

GameDataRef _data
 Shared pointer for game data. More...
 
ScoreTimeRef _scoreTime
 Shared pointer for score and time. More...
 
sf::Sound _crowdCheerOnGoal
 Croud cheering sound. More...
 
sf::Sprite _background
 Background sprite to draw on the screen. More...
 
bool _isSecondHalf
 Store whether it is first half or second. More...
 
int _animationCounter
 Counter for animation of movements. More...
 

Detailed Description

Derived class of State class with visibility mode public that checks whether the player has scored goal or not and updates the state.

Constructor & Destructor Documentation

◆ GoalState()

HeadBall::GoalState::GoalState ( GameDataRef  data,
ScoreTimeRef  scoretime,
bool  isSecondHalf 
)

Construct a new Goal State object.

Parameters
dataThe shared pointer of GameData
scoretimeThe shared pointer of ScoreTimeData
isSecondHalfThe boolean variable that checks whether the half is second or not

Member Function Documentation

◆ animate()

virtual void HeadBall::State::animate ( )
inlinevirtualinherited

Vitrual function for performing animations.

◆ draw()

void HeadBall::GoalState::draw ( )
virtual

Draws all the SFML objects of Goal state.

Implements HeadBall::State.

◆ handleInput()

void HeadBall::GoalState::handleInput ( )
virtual

Handles all the input during goalstate.

Implements HeadBall::State.

◆ init()

void HeadBall::GoalState::init ( )
virtual

Initialze a new GoalState object.

Implements HeadBall::State.

◆ pause()

virtual void HeadBall::State::pause ( )
inlinevirtualinherited

Virtual function for pausing the state.

Reimplemented in HeadBall::GameState.

◆ resume()

virtual void HeadBall::State::resume ( )
inlinevirtualinherited

Virtual function for resuming the object.

Reimplemented in HeadBall::GameState.

◆ update()

void HeadBall::GoalState::update ( )
virtual

Updates the rendering window as per the provided inputs.

Implements HeadBall::State.

Member Data Documentation

◆ _animationCounter

int HeadBall::GoalState::_animationCounter
private

Counter for animation of movements.

◆ _background

sf::Sprite HeadBall::GoalState::_background
private

Background sprite to draw on the screen.

◆ _crowdCheerOnGoal

sf::Sound HeadBall::GoalState::_crowdCheerOnGoal
private

Croud cheering sound.

◆ _data

GameDataRef HeadBall::GoalState::_data
private

Shared pointer for game data.

◆ _isSecondHalf

bool HeadBall::GoalState::_isSecondHalf
private

Store whether it is first half or second.

◆ _scoreTime

ScoreTimeRef HeadBall::GoalState::_scoreTime
private

Shared pointer for score and time.


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