FYP  1.0.0
Final Year Project -- Alexander Meuer
Damage::Reduction Struct Reference

Damage Reduction, such as Armour or Magic Resistance. Used to reduce damage by an appropriate amount. Usage: Damage::Reduction mArmour = Damage::Reduction::MEDIUM;. More...

#include <Damage.hpp>

Collaboration diagram for Damage::Reduction:
Collaboration graph

Public Member Functions

float grant ()
 Grants a level of reduction if below the max.
 
float strip ()
 Strips a level of reduction if above none.
 
 Reduction (const float _value)
 
float operator* (float damage) const
 Applies the reduction to the float passed.
 
Reductionoperator= (float newValue)
 Assigns a new reduction value.
 
bool operator< (Reduction const &other) const
 Returns true if we have a lower value.
 
bool operator<= (Reduction const &other) const
 Returns true if we have a lower or equal value.
 

Public Attributes

float value
 Damage reduction multiplier.
 

Static Public Attributes

static const float NONE
 
static const float LIGHT
 
static const float MEDIUM
 
static const float HEAVY
 
static const float IMMUNE
 

Friends

float operator*= (float num, Reduction &red)
 Applies the reduction to the float passed.
 

Detailed Description

Damage Reduction, such as Armour or Magic Resistance. Used to reduce damage by an appropriate amount. Usage: Damage::Reduction mArmour = Damage::Reduction::MEDIUM;.

See also
Pawn::takeDamage().

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