Skip to content

Latest commit

 

History

History
240 lines (172 loc) · 7 KB

namespaceutils_1_1constant.md

File metadata and controls

240 lines (172 loc) · 7 KB
title
utils::constant

utils::constant

Classes

Name
struct utils::constant::ButtonValue

Types

Name
enum PacketType { PLAYER_MOVE = 8, PLAYER_SHOT = 2, PLAYER_CHARGED_SHOT, PLAYER_POWERUP, ENTITY_MOVE, ENTITY_SPAWN, ENTITY_DEATH, ENTITY_DAMAGE, ENTITY_HEAL, NEW_WAVE, BOSS_STAGE, GAME_OVER, MULTIPLAYER_INFO, HEALTH_UPDATE, NONE}
enum ButtonActionType { PLAY_ACTION, QUIT_ACTION, OPTIONS_ACTION, CONNECT_ACTION}
enum ButtonType { PLAY, OPTION, QUIT, PLAY_HOVER, OPTION_HOVER, QUIT_HOVER, ROOM, ROOM_HOVER, ROOM_TEXT, OPTION_INTERFACE, SOUND_LEFT, SOUND_RIGHT, SOUND_LEFT_HOVER, SOUND_RIGHT_HOVER, MUSIC_LEFT, MUSIC_RIGHT, MUSIC_RIGHT_HOVER, MUSIC_LEFT_HOVER, HOW_TO, HOW_TO_HOVER, SLIDE_MUSIC, SLIDE_SOUND, SOUND_BAR, SETTINGS, SETTINGS_HOVER, OPTIONS_TEXT, PLANET, UNDEFINED}
using std::chrono::high_resolution_clock chrono
using std::chrono::duration< double, std::milli > chronoDuration

Functions

Name
int getPacketTypeKey(PacketType type)

Attributes

Name
const std::size_t npos
short mapWidth
short mapHeight
short maxPlayerHealth
short sizeHealthBar
const std::map< ButtonType, ButtonValue > buttonValueMap
std::map< int, PacketType > mapPacketType

Types Documentation

enum PacketType

Enumerator Value Description
PLAYER_MOVE 8
PLAYER_SHOT 2
PLAYER_CHARGED_SHOT
PLAYER_POWERUP
ENTITY_MOVE
ENTITY_SPAWN
ENTITY_DEATH
ENTITY_DAMAGE
ENTITY_HEAL
NEW_WAVE
BOSS_STAGE
GAME_OVER
MULTIPLAYER_INFO
HEALTH_UPDATE
NONE

enum ButtonActionType

Enumerator Value Description
PLAY_ACTION
QUIT_ACTION
OPTIONS_ACTION
CONNECT_ACTION

enum ButtonType

Enumerator Value Description
PLAY
OPTION
QUIT
PLAY_HOVER
OPTION_HOVER
QUIT_HOVER
ROOM
ROOM_HOVER
ROOM_TEXT
OPTION_INTERFACE
SOUND_LEFT
SOUND_RIGHT
SOUND_LEFT_HOVER
SOUND_RIGHT_HOVER
MUSIC_LEFT
MUSIC_RIGHT
MUSIC_RIGHT_HOVER
MUSIC_LEFT_HOVER
HOW_TO
HOW_TO_HOVER
SLIDE_MUSIC
SLIDE_SOUND
SOUND_BAR
SETTINGS
SETTINGS_HOVER
OPTIONS_TEXT
PLANET
UNDEFINED

using chrono

using utils::constant::chrono = typedef std::chrono::high_resolution_clock;

using chronoDuration

using utils::constant::chronoDuration = typedef std::chrono::duration<double, std::milli>;

Functions Documentation

function getPacketTypeKey

static int getPacketTypeKey(
    PacketType type
)

Attributes Documentation

variable npos

static const std::size_t npos = -1;

variable mapWidth

static short mapWidth = 1920;

variable mapHeight

static short mapHeight = 1080;

variable maxPlayerHealth

static short maxPlayerHealth = 100;

variable sizeHealthBar

static short sizeHealthBar = 282;

variable buttonValueMap

static const std::map< ButtonType, ButtonValue > buttonValueMap {
            {PLAY, {324, 2079, 916, 292, 300, 100, 300, 280}},
            {OPTION, {3651, 2079, 916, 292, 300, 100, 300, 480}},
            {QUIT, {4760, 2079, 916, 292, 300, 100, 300, 680}},
            {PLAY_HOVER, {220, 2449, 1114, 356, 300, 100, 300, 280}},
            {OPTION_HOVER, {3542, 2456, 1114, 356, 300, 100, 300, 450}},
            {QUIT_HOVER, {4670, 2451, 1114, 356, 300, 100, 300, 620}},
            {ROOM, {326, 456, 1114, 356, 400, 100, 850, 250}},
            {OPTION_INTERFACE, {1692, 168, 1589, 1790, 692, 772, 800, 100}},
            {SOUND_LEFT, {3813, 178, 255, 256, 55, 55, 1260, 560}},
            {SOUND_RIGHT, {3489, 434, 255, 256, 55, 55, 1325, 560}},
            {SOUND_LEFT_HOVER, {3489, 178, 255, 256, 55, 55, 1260, 560}},
            {SOUND_RIGHT_HOVER, {3813, 434, 255, 256, 55, 55, 1325, 560}},
            {MUSIC_LEFT, {3813, 178, 255, 256, 55, 55, 1260, 360}},
            {MUSIC_RIGHT, {3489, 434, 255, 256, 55, 55, 1325, 360}},
            {MUSIC_LEFT_HOVER, {3489, 178, 255, 256, 55, 55, 1260, 360}},
            {MUSIC_RIGHT_HOVER, {3813, 434, 255, 256, 55, 55, 1325, 360}},
            {HOW_TO, {4137, 434, 255, 256, 55, 55, 1250, 700}},
            {HOW_TO_HOVER, {4137, 178, 255, 256, 55, 55, 1250, 700}},
            {SLIDE_SOUND, {4396, 1486, 97, 146, 21, 31, 1070, 572}},
            {SLIDE_MUSIC, {4396, 1486, 97, 146, 21, 31, 1070, 372}},
            {SOUND_BAR, {3476, 1692, 2213, 168, 350, 36, 900, 370}},
            {SETTINGS, {4461, 435, 255, 255, 55, 55, 970, 700}},
            {SETTINGS_HOVER, {4461, 178, 255, 255, 55, 55, 970, 700}},

        };

variable mapPacketType

static std::map< int, PacketType > mapPacketType {
            {1, PLAYER_MOVE},
            {2, PLAYER_SHOT},
            {4, PLAYER_CHARGED_SHOT},
            {8, ENTITY_MOVE},
            {16, ENTITY_SPAWN},
            {17, ENTITY_DEATH},
            {32, ENTITY_DAMAGE},
            {34, ENTITY_HEAL},
            {64, PLAYER_POWERUP},
            {3, NEW_WAVE},
            {7, BOSS_STAGE},
            {15, GAME_OVER},
            {31, MULTIPLAYER_INFO},
            {38, HEALTH_UPDATE}
        };

Updated on 2022-11-13 at 17:21:37 +0100