DoopelPonger
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
CoopPlayerPowerUp Class Referenceabstract

Parent class for every power up a player can use. More...

Inheritance diagram for CoopPlayerPowerUp:
Inheritance graph
[legend]
Collaboration diagram for CoopPlayerPowerUp:
Collaboration graph
[legend]

Public Member Functions

void Awake ()
 Initialize all references of the power up and make sure the child class has had their awake method called. More...
 
void Init ()
 Initialize the values of the power up and make sure the child class has had their init method called. More...
 
void TriggerPowerUp (CoopPowerUpController powerUpController)
 The player has triggered the power up and the power up should now do the actions. More...
 
void FixedUpdate ()
 Reccord how long the power up has been active and call the child FixedUpdate method. More...
 
void RemovePowerUp (bool rightNow)
 Force the power up to end. Used when a player has full charge and then uses the shield to drain the charge causing the power up to go away. More...
 

Public Attributes

CoopPlayer player
 
Texture2D textureIcon
 

Protected Member Functions

void PowerUpFinished ()
 Available for children to call if they want to power up to end right now. More...
 
void DestroyPowerUp ()
 Available for children to call if they want to power up to end right now without any norifications to other systems. More...
 
abstract void ChildAwake ()
 Allows for implementations to initialize references before use. More...
 
abstract void ChildInit ()
 Allows for implementations to initialize variables before use. More...
 
abstract void ChildTriggerPowerUp ()
 Method called when the player has activated the power up. More...
 
abstract void ChildFixedUpdate ()
 Method called during the fixed update tick. More...
 
abstract void ChildDespawnPowerUp (bool rightNow)
 The class needs to clean up everything because the power up is not going to be used anymore. More...
 
abstract float GetMaxTime ()
 
abstract void TimeUp ()
 The maxTime of the power up has been reached and the child should despawn the power up. More...
 

Protected Attributes

EventManager eventManager
 
CoopObjectPooler objectPooler
 

Detailed Description

Parent class for every power up a player can use.

Member Function Documentation

◆ Awake()

void CoopPlayerPowerUp.Awake ( )

Initialize all references of the power up and make sure the child class has had their awake method called.

◆ ChildAwake()

abstract void CoopPlayerPowerUp.ChildAwake ( )
protectedpure virtual

◆ ChildDespawnPowerUp()

abstract void CoopPlayerPowerUp.ChildDespawnPowerUp ( bool  rightNow)
protectedpure virtual

The class needs to clean up everything because the power up is not going to be used anymore.

Parameters
rightNowUsed to also tell the power up to destory itself immediately. As of right now, this use case isn't actually used.

Implemented in CoopVShooterController, CoopPlayerVomitPowerUp, CoopBoomerangController, CoopHomingMissileController, CoopMiniShooterController, CoopPlayerLaserController, CoopHealthBackPowerUp, and CoopSlowMoPowerUp.

◆ ChildFixedUpdate()

abstract void CoopPlayerPowerUp.ChildFixedUpdate ( )
protectedpure virtual

◆ ChildInit()

abstract void CoopPlayerPowerUp.ChildInit ( )
protectedpure virtual

◆ ChildTriggerPowerUp()

abstract void CoopPlayerPowerUp.ChildTriggerPowerUp ( )
protectedpure virtual

◆ DestroyPowerUp()

void CoopPlayerPowerUp.DestroyPowerUp ( )
protected

Available for children to call if they want to power up to end right now without any norifications to other systems.

◆ FixedUpdate()

void CoopPlayerPowerUp.FixedUpdate ( )

Reccord how long the power up has been active and call the child FixedUpdate method.

◆ GetMaxTime()

abstract float CoopPlayerPowerUp.GetMaxTime ( )
protectedpure virtual
Returns
The total amount of time the power up should stay alive before being deactivated.

Implemented in CoopHomingMissileController, CoopPlayerVomitPowerUp, CoopMiniShooterController, CoopBoomerangController, CoopVShooterController, CoopPlayerLaserController, CoopHealthBackPowerUp, and CoopSlowMoPowerUp.

◆ Init()

void CoopPlayerPowerUp.Init ( )

Initialize the values of the power up and make sure the child class has had their init method called.

◆ PowerUpFinished()

void CoopPlayerPowerUp.PowerUpFinished ( )
protected

Available for children to call if they want to power up to end right now.

◆ RemovePowerUp()

void CoopPlayerPowerUp.RemovePowerUp ( bool  rightNow)

Force the power up to end. Used when a player has full charge and then uses the shield to drain the charge causing the power up to go away.

Parameters
rightNowUsed to also tell the power up to destory itself immediately. As of right now, this use case isn't actually used.

◆ TimeUp()

abstract void CoopPlayerPowerUp.TimeUp ( )
protectedpure virtual

The maxTime of the power up has been reached and the child should despawn the power up.

Implemented in CoopHomingMissileController, CoopPlayerVomitPowerUp, CoopMiniShooterController, CoopBoomerangController, CoopVShooterController, CoopPlayerLaserController, CoopHealthBackPowerUp, and CoopSlowMoPowerUp.

◆ TriggerPowerUp()

void CoopPlayerPowerUp.TriggerPowerUp ( CoopPowerUpController  powerUpController)

The player has triggered the power up and the power up should now do the actions.

Parameters
powerUpControllerThe power up controller that spawned the power up.

Member Data Documentation

◆ eventManager

EventManager CoopPlayerPowerUp.eventManager
protected

◆ objectPooler

CoopObjectPooler CoopPlayerPowerUp.objectPooler
protected

◆ player

CoopPlayer CoopPlayerPowerUp.player

The player the power up belongs to.

◆ textureIcon

Texture2D CoopPlayerPowerUp.textureIcon

The image of the power up that is displayed in the UI once the power up is chosen.


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