R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
RType::Messages::Shared Namespace Reference

Classes

struct  PlayerInputDTO
 Data Transfer Object for player input. More...
 
struct  Vec2
 C++ wrapper for Vec2 position. More...
 

Enumerations

enum class  Action {
  MoveUp = 0 , MoveDown = 1 , MoveLeft = 2 , MoveRight = 3 ,
  Shoot = 4
}
 Player action enum - matches Cap'n Proto enum. More...
 
enum class  EntityType {
  Player = 0 , EnemyType1 = 1 , PlayerBullet = 2 , EnemyBullet = 3 ,
  Wall = 4 , OrbitalModule = 5
}
 Entity type enum - matches Cap'n Proto enum. More...
 
enum class  DestroyReason { KilledByPlayer = 0 , OutOfBounds = 1 , Collision = 2 }
 Destroy reason enum - matches Cap'n Proto enum. More...
 

Functions

inline ::Action toCapnpAction (Action action)
 
Action fromCapnpAction (::Action action)
 
inline ::EntityType toCapnpEntityType (EntityType type)
 
EntityType fromCapnpEntityType (::EntityType type)
 
inline ::DestroyReason toCapnpDestroyReason (DestroyReason reason)
 
DestroyReason fromCapnpDestroyReason (::DestroyReason reason)
 

Enumeration Type Documentation

◆ Action

Player action enum - matches Cap'n Proto enum.

Enumerator
MoveUp 
MoveDown 
MoveLeft 
MoveRight 
Shoot 

Definition at line 48 of file SharedTypes.hpp.

◆ DestroyReason

Destroy reason enum - matches Cap'n Proto enum.

Enumerator
KilledByPlayer 
OutOfBounds 
Collision 

Definition at line 65 of file SharedTypes.hpp.

◆ EntityType

Entity type enum - matches Cap'n Proto enum.

Enumerator
Player 
EnemyType1 
PlayerBullet 
EnemyBullet 
Wall 
OrbitalModule 

Definition at line 53 of file SharedTypes.hpp.

Function Documentation

◆ fromCapnpAction()

Action RType::Messages::Shared::fromCapnpAction ( ::Action  action)
inline

◆ fromCapnpDestroyReason()

DestroyReason RType::Messages::Shared::fromCapnpDestroyReason ( ::DestroyReason  reason)
inline

◆ fromCapnpEntityType()

EntityType RType::Messages::Shared::fromCapnpEntityType ( ::EntityType  type)
inline

◆ toCapnpAction()

inline ::Action RType::Messages::Shared::toCapnpAction ( Action  action)

Definition at line 68 of file SharedTypes.hpp.

References MoveDown, MoveLeft, MoveRight, MoveUp, Shoot, and UNREACHABLE.

Referenced by RType::Messages::C2S::PlayerInput::serialize().

◆ toCapnpDestroyReason()

inline ::DestroyReason RType::Messages::Shared::toCapnpDestroyReason ( DestroyReason  reason)

◆ toCapnpEntityType()

inline ::EntityType RType::Messages::Shared::toCapnpEntityType ( EntityType  type)