![]() |
Space Fighter
A "shmup" game for Computer Programming C++
|
Represents a type of collision. More...
#include <CollisionType.h>
Public Member Functions | |
| CollisionType () | |
| Instantiate a collision type object. | |
| virtual | ~CollisionType () |
| CollisionType & | operator= (const CollisionType &type) |
| bool | operator== (const CollisionType &type) const |
| bool | operator!= (const CollisionType &type) const |
| bool | operator< (const CollisionType &type) const |
| bool | operator> (const CollisionType &type) const |
| const CollisionType | operator| (const CollisionType &type) const |
| CollisionType & | operator|= (const CollisionType &type) |
| const CollisionType | operator& (const CollisionType &type) const |
| CollisionType & | operator&= (const CollisionType &type) |
| const CollisionType | operator^ (const CollisionType &type) const |
| CollisionType & | operator^= (const CollisionType &type) |
| bool | Contains (const CollisionType &type) const |
| Check if the collision type contains a specific type. | |
Static Public Attributes | |
| static const CollisionType | None = CollisionType(0) |
| static const CollisionType | Player = CollisionType(1 << 0) |
| static const CollisionType | Enemy = CollisionType(1 << 1) |
| static const CollisionType | Ship = CollisionType(1 << 2) |
| static const CollisionType | Projectile = CollisionType(1 << 3) |
Protected Member Functions | |
| CollisionType (const unsigned short value) | |
| Instantiate a collision type object with a specific value. | |
Represents a type of collision.
Each collision type is represented by a unique bit-mask value. This allows for complex types without the need for a large number of unique values. It basically allows for a single number to represent multiple boolean values. For example, a collision type "player projectile" would be created by combining the "player" and "projectile" types, while an "enemy projectile" would be created by combining the "enemy" and "projectile" types.
Definition at line 11 of file CollisionType.h.
|
inline |
Instantiate a collision type object.
Definition at line 17 of file CollisionType.h.
|
inlinevirtual |
Definition at line 18 of file CollisionType.h.
|
inlineprotected |
Instantiate a collision type object with a specific value.
| value | The value of the collision type. |
Definition at line 104 of file CollisionType.h.
|
inline |
Check if the collision type contains a specific type.
| type | The type to check. |
Definition at line 94 of file CollisionType.h.
|
inline |
Definition at line 40 of file CollisionType.h.
|
inline |
Definition at line 67 of file CollisionType.h.
|
inline |
Definition at line 72 of file CollisionType.h.
|
inline |
Definition at line 45 of file CollisionType.h.
|
inline |
Definition at line 29 of file CollisionType.h.
|
inline |
Definition at line 35 of file CollisionType.h.
|
inline |
Definition at line 50 of file CollisionType.h.
|
inline |
Definition at line 79 of file CollisionType.h.
|
inline |
Definition at line 84 of file CollisionType.h.
|
inline |
Definition at line 55 of file CollisionType.h.
|
inline |
Definition at line 60 of file CollisionType.h.
|
static |
Definition at line 24 of file CollisionType.h.
|
static |
Definition at line 21 of file CollisionType.h.
|
static |
Definition at line 23 of file CollisionType.h.
|
static |
Definition at line 27 of file CollisionType.h.
|
static |
Definition at line 26 of file CollisionType.h.