static TERM_COLOR birth_class_color(int cs)
{
if (cs < MAX_CLASS) {
- if (is_retired_class(i2enum<player_class_type>(cs)))
+ if (is_retired_class(i2enum<PlayerClassType>(cs)))
return TERM_L_DARK;
- if (is_winner_class(i2enum<player_class_type>(cs)))
+ if (is_winner_class(i2enum<PlayerClassType>(cs)))
return TERM_SLATE;
}
return TERM_WHITE;
if (!select_class(player_ptr, cur, sym, &k))
return false;
- player_ptr->pclass = i2enum<player_class_type>(k);
+ player_ptr->pclass = i2enum<PlayerClassType>(k);
cp_ptr = &class_info[player_ptr->pclass];
mp_ptr = &m_info[player_ptr->pclass];
c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 15);
struct birther {
player_sex psex{}; /* Sex index */
PlayerRaceType prace{}; /* Race index */
- player_class_type pclass{}; /* Class index */
+ PlayerClassType pclass{}; /* Class index */
player_personality_type ppersonality{}; /* Seikaku index */
int16_t realm1{}; /* First magic realm */
int16_t realm2{}; /* Second magic realm */
int n;
n = tokenize(s + 2, MAX_CLASS, zz, 0);
for (int i = 0; i < MAX_CLASS; i++) {
- building[index].member_class[i] = i2enum<player_class_type>((i < n) ? atoi(zz[i]) : 1);
+ building[index].member_class[i] = i2enum<PlayerClassType>((i < n) ? atoi(zz[i]) : 1);
}
break;
std::string s = "";
std::string l = "";
for (int c = 0; c < MAX_CLASS; c++) {
- if (w_ptr->sf_winner.has_not(i2enum<player_class_type>(c)))
+ if (w_ptr->sf_winner.has_not(i2enum<PlayerClassType>(c)))
continue;
auto &cl = class_info[c];
auto t = std::string(cl.title);
- if (w_ptr->sf_retired.has_not(i2enum<player_class_type>(c)))
+ if (w_ptr->sf_retired.has_not(i2enum<PlayerClassType>(c)))
t = "(" + t + ")";
if (l.size() + t.size() + 2 > max_len) {
rd_byte(&tmp8u);
previous_char.prace = (PlayerRaceType)tmp8u;
rd_byte(&tmp8u);
- previous_char.pclass = (player_class_type)tmp8u;
+ previous_char.pclass = (PlayerClassType)tmp8u;
rd_byte(&tmp8u);
previous_char.ppersonality = (player_personality_type)tmp8u;
rd_byte(&tmp8u);
player_ptr->prace = (PlayerRaceType)tmp8u;
rd_byte(&tmp8u);
- player_ptr->pclass = (player_class_type)tmp8u;
+ player_ptr->pclass = (PlayerClassType)tmp8u;
rd_byte(&tmp8u);
player_ptr->ppersonality = (player_personality_type)tmp8u;
#pragma once
-enum player_class_type {
+enum PlayerClassType {
CLASS_WARRIOR = 0,
CLASS_MAGE = 1,
CLASS_PRIEST = 2,
struct player_race_condition {
tr_type type{};
PLAYER_LEVEL level{};
- std::optional<player_class_type> pclass{};
+ std::optional<PlayerClassType> pclass{};
bool not_class{};
- player_race_condition(tr_type t, PLAYER_LEVEL l = 1, const std::optional<player_class_type> &c = std::nullopt, bool nc = false)
+ player_race_condition(tr_type t, PLAYER_LEVEL l = 1, const std::optional<PlayerClassType> &c = std::nullopt, bool nc = false)
: type(t)
, level(l)
, pclass(c)
int16_t actions[8]; /*!< 町の施設処理における行動ID */
int16_t action_restr[8]; /*!< 町の施設処理の規制処理ID */
- player_class_type member_class[MAX_CLASS]; /* which classes are part of guild */
+ PlayerClassType member_class[MAX_CLASS]; /* which classes are part of guild */
PlayerRaceType member_race[MAX_RACES]; /* which classes are part of guild */
int16_t member_realm[MAX_MAGIC + 1]; /* ギルド (店主?)ごとの魔法領域ID / which realms are part of guild */
};
player_sex psex{}; /* Sex index */
PlayerRaceType prace{}; /* Race index */
- player_class_type pclass{}; /* Class index */
+ PlayerClassType pclass{}; /* Class index */
player_personality_type ppersonality{}; /* Personality index */
int16_t realm1{}; /* First magic realm */
int16_t realm2{}; /* Second magic realm */
if (tmp_int < 0 || tmp_int >= MAX_CLASS)
return;
- player_ptr->pclass = i2enum<player_class_type>(tmp_int);
+ player_ptr->pclass = i2enum<PlayerClassType>(tmp_int);
cp_ptr = &class_info[player_ptr->pclass];
mp_ptr = &m_info[player_ptr->pclass];
PlayerClass(player_ptr).init_specific_data();
/*!
* @brief 勝利したクラスを追加する
*/
-void add_winner_class(player_class_type c)
+void add_winner_class(PlayerClassType c)
{
if (!w_ptr->noscore)
w_ptr->sf_winner.set(c);
/*!
* @brief 引退したクラスを追加する
*/
-void add_retired_class(player_class_type c)
+void add_retired_class(PlayerClassType c)
{
if (!w_ptr->noscore)
w_ptr->sf_retired.set(c);
/*!
* @brief 勝利したクラスか判定する
*/
-bool is_winner_class(player_class_type c)
+bool is_winner_class(PlayerClassType c)
{
if (c == MAX_CLASS)
return false;
/*!
* @brief 引退したクラスか判定する
*/
-bool is_retired_class(player_class_type c)
+bool is_retired_class(PlayerClassType c)
{
if (c == MAX_CLASS)
return false;
uint16_t sf_lives{}; //!< このセーブファイルで何人プレイしたか / Number of past "lives" with this file
uint16_t sf_saves{}; //!< 現在のプレイで何回セーブしたか / Number of "saves" during this life
uint32_t sf_play_time{}; //!< このセーブファイルで遊んだ合計のプレイ時間
- FlagGroup<player_class_type, MAX_CLASS> sf_winner{}; //!< このセーブファイルで*勝利*した職業
- FlagGroup<player_class_type, MAX_CLASS> sf_retired{}; //!< このセーブファイルで引退した職業
+ FlagGroup<PlayerClassType, MAX_CLASS> sf_winner{}; //!< このセーブファイルで*勝利*した職業
+ FlagGroup<PlayerClassType, MAX_CLASS> sf_retired{}; //!< このセーブファイルで引退した職業
bool character_generated{}; /* The character exists */
bool character_dungeon{}; /* The character has a dungeon */
bool is_daytime(void);
void extract_day_hour_min(player_type *player_ptr, int *day, int *hour, int *min);
void update_playtime(void);
-void add_winner_class(player_class_type c);
-void add_retired_class(player_class_type c);
-bool is_winner_class(player_class_type c);
-bool is_retired_class(player_class_type c);
+void add_winner_class(PlayerClassType c);
+void add_retired_class(PlayerClassType c);
+bool is_winner_class(PlayerClassType c);
+bool is_retired_class(PlayerClassType c);