Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
Loading...
Searching...
No Matches
piece_type.hpp
Go to the documentation of this file.
1
11
12#ifndef ZOAPPGAMEPIECETYPE_H
13#define ZOAPPGAMEPIECETYPE_H
14
15#include <string>
16#include <cstdint>
17#include <array>
18
19#include "piece_type_id.hpp"
20
26struct PieceType {
32 ONE_BEFORE_ROSETTE, //< Applicable only to the swallow piece; can be launched to a house one location before a rosette.
33 SAME_AS_LAUNCH_ROLL, //< Applicable to most pieces; launch house must be (along the route) ordinally equal to the launch roll.
34 };
35
40 std::string mName;
41
46 uint8_t mLaunchRoll;
47
53
58 uint8_t mCost;
59};
60
66inline const std::array<const PieceType, 5> kGamePieceTypes {{
67 {.mName="swallow", .mLaunchRoll=2, .mLaunchType=PieceType::LaunchType::ONE_BEFORE_ROSETTE, .mCost=3},
68 {.mName="storm-bird", .mLaunchRoll=5, .mLaunchType=PieceType::LaunchType::SAME_AS_LAUNCH_ROLL, .mCost=4},
69 {.mName="raven", .mLaunchRoll=6, .mLaunchType=PieceType::LaunchType::SAME_AS_LAUNCH_ROLL, .mCost=4},
70 {.mName="rooster", .mLaunchRoll=7, .mLaunchType=PieceType::LaunchType::SAME_AS_LAUNCH_ROLL, .mCost=4},
71 {.mName="eagle", .mLaunchRoll=10, .mLaunchType=PieceType::LaunchType::SAME_AS_LAUNCH_ROLL, .mCost=5},
72}};
73
74#endif
const std::array< const PieceType, 5 > kGamePieceTypes
An array of PieceTypes, each element describing a single type of piece used in the game.
Definition piece_type.hpp:66
Contains enum listing the different types of pieces present in the game.
A struct containing information about a piece, including its name and information.
Definition piece_type.hpp:26
uint8_t mLaunchRoll
The roll required in order to launch this type of piece.
Definition piece_type.hpp:46
uint8_t mCost
The number of counters won or lost depending on whether or not this piece succeeds in landing on a ro...
Definition piece_type.hpp:58
LaunchType mLaunchType
The type of launch action applicable to this piece.
Definition piece_type.hpp:52
LaunchType
The way a piece of some type can be launched.
Definition piece_type.hpp:31
std::string mName
The name of this type of piece, for display.
Definition piece_type.hpp:40