VirtualC64 v5.0 beta
Commodore 64 Emulator
Loading...
Searching...
No Matches
PaddleTypes.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2// This file is part of VirtualC64
3//
4// Copyright (C) Dirk W. Hoffmann. www.dirkwhoffmann.de
5// This FILE is dual-licensed. You are free to choose between:
6//
7// - The GNU General Public License v3 (or any later version)
8// - The Mozilla Public License v2
9//
10// SPDX-License-Identifier: GPL-3.0-or-later OR MPL-2.0
11// -----------------------------------------------------------------------------
13
14#pragma once
15
16#include "Reflection.h"
17
18namespace vc64 {
19
20//
21// Enumerations
22//
23
32typedef PADDLE_ORIENTATION PaddleOrientation;
33
34struct PaddleOrientationEnum : util::Reflection<PaddleOrientationEnum, PaddleOrientation> {
35
36 static constexpr long minVal = 0;
37 static constexpr long maxVal = PADDLE_VERTICAL_FLIPPED;
38 static bool isValid(auto value) { return value >= minVal && value <= maxVal; }
39
40 static const char *prefix() { return nullptr; }
41 static const char *key(long value)
42 {
43 switch (value) {
44
45 case PADDLE_HORIZONTAL: return "HORIZONTAL";
46 case PADDLE_HORIZONTAL_FLIPPED: return "HORIZONTAL_FLIPPED";
47 case PADDLE_VERTICAL: return "VERTICAL";
48 case PADDLE_VERTICAL_FLIPPED: return "VERTICAL_FLIPPED";
49 }
50 return "???";
51 }
52};
53
54//
55// Structures
56//
57
58typedef struct
59{
60 PaddleOrientation orientation;
61}
62PaddleConfig;
63
64typedef struct
65{
66
67}
68PaddleInfo;
69
70}
VirtualC64 project namespace.
Definition CmdQueue.cpp:16
PADDLE_ORIENTATION
Value mapping scheme.
Definition PaddleTypes.h:26
@ PADDLE_VERTICAL
Vertical.
Definition PaddleTypes.h:29
@ PADDLE_HORIZONTAL
Horizontal.
Definition PaddleTypes.h:27
@ PADDLE_HORIZONTAL_FLIPPED
Horizontal, reverse direction.
Definition PaddleTypes.h:28
@ PADDLE_VERTICAL_FLIPPED
Vertical, reverse direction.
Definition PaddleTypes.h:30