Space Fighter
A "shmup" game for Computer Programming C++
Loading...
Searching...
No Matches
TriggerType Class Reference

Represents a type of trigger, which can be used to activate weapons. More...

#include <TriggerType.h>

Public Member Functions

 TriggerType ()
 Instantiate a trigger type object.
 
virtual ~TriggerType ()
 
TriggerTypeoperator= (const TriggerType &type)
 
bool operator== (const TriggerType &type) const
 
bool operator!= (const TriggerType &type) const
 
bool operator< (const TriggerType &type) const
 
bool operator> (const TriggerType &type) const
 
const TriggerType operator| (const TriggerType &type) const
 
TriggerTypeoperator|= (const TriggerType &type)
 
const TriggerType operator& (const TriggerType &type) const
 
TriggerTypeoperator&= (const TriggerType &type)
 
const TriggerType operator^ (const TriggerType &type) const
 
TriggerTypeoperator^= (const TriggerType &type)
 
bool Contains (const TriggerType &type) const
 Check if the trigger type contains a specific trigger.
 

Static Public Attributes

static const TriggerType None = TriggerType(0)
 
static const TriggerType Primary = TriggerType(1 << 0)
 
static const TriggerType Secondary = TriggerType(1 << 1)
 
static const TriggerType Special = TriggerType(1 << 2)
 
static const TriggerType All = TriggerType((unsigned short)(-1))
 

Protected Member Functions

 TriggerType (const unsigned short value)
 Instantiate a trigger type object with a specific value.
 

Detailed Description

Represents a type of trigger, which can be used to activate weapons.

Each trigger type is represented by a unique bit-mask value. This class helps to decouple the weapon system from the input system.

Definition at line 7 of file TriggerType.h.

Constructor & Destructor Documentation

◆ TriggerType() [1/2]

TriggerType::TriggerType ( )
inline

Instantiate a trigger type object.

Definition at line 13 of file TriggerType.h.

◆ ~TriggerType()

virtual TriggerType::~TriggerType ( )
inlinevirtual

Definition at line 14 of file TriggerType.h.

◆ TriggerType() [2/2]

TriggerType::TriggerType ( const unsigned short value)
inlineprotected

Instantiate a trigger type object with a specific value.

Parameters
valueThe value of the trigger type.

Definition at line 99 of file TriggerType.h.

Member Function Documentation

◆ Contains()

bool TriggerType::Contains ( const TriggerType & type) const
inline

Check if the trigger type contains a specific trigger.

Parameters
typeThe trigger type to check.
Returns
True if the trigger type contains the specified trigger.

Definition at line 89 of file TriggerType.h.

◆ operator!=()

bool TriggerType::operator!= ( const TriggerType & type) const
inline

Definition at line 35 of file TriggerType.h.

◆ operator&()

const TriggerType TriggerType::operator& ( const TriggerType & type) const
inline

Definition at line 62 of file TriggerType.h.

◆ operator&=()

TriggerType & TriggerType::operator&= ( const TriggerType & type)
inline

Definition at line 67 of file TriggerType.h.

◆ operator<()

bool TriggerType::operator< ( const TriggerType & type) const
inline

Definition at line 40 of file TriggerType.h.

◆ operator=()

TriggerType & TriggerType::operator= ( const TriggerType & type)
inline

Definition at line 23 of file TriggerType.h.

◆ operator==()

bool TriggerType::operator== ( const TriggerType & type) const
inline

Definition at line 30 of file TriggerType.h.

◆ operator>()

bool TriggerType::operator> ( const TriggerType & type) const
inline

Definition at line 45 of file TriggerType.h.

◆ operator^()

const TriggerType TriggerType::operator^ ( const TriggerType & type) const
inline

Definition at line 74 of file TriggerType.h.

◆ operator^=()

TriggerType & TriggerType::operator^= ( const TriggerType & type)
inline

Definition at line 79 of file TriggerType.h.

◆ operator|()

const TriggerType TriggerType::operator| ( const TriggerType & type) const
inline

Definition at line 50 of file TriggerType.h.

◆ operator|=()

TriggerType & TriggerType::operator|= ( const TriggerType & type)
inline

Definition at line 55 of file TriggerType.h.

Member Data Documentation

◆ All

const TriggerType TriggerType::All = TriggerType((unsigned short)(-1))
static

Definition at line 20 of file TriggerType.h.

◆ None

const TriggerType TriggerType::None = TriggerType(0)
static

Definition at line 16 of file TriggerType.h.

◆ Primary

const TriggerType TriggerType::Primary = TriggerType(1 << 0)
static

Definition at line 17 of file TriggerType.h.

◆ Secondary

const TriggerType TriggerType::Secondary = TriggerType(1 << 1)
static

Definition at line 18 of file TriggerType.h.

◆ Special

const TriggerType TriggerType::Special = TriggerType(1 << 2)
static

Definition at line 19 of file TriggerType.h.


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