OSDN Git Service

Merge branch 'develop' into macos-develop
[hengbandforosx/hengbandosx.git] / src / timed-effect / player-blindness.cpp
1 /*!
2  * @brief プレイヤーの盲目ステータス変更と判定
3  * @date 2022/08/30
4  * @author Hourier
5  */
6
7 #include "timed-effect/player-blindness.h"
8 #include "system/angband-exceptions.h"
9
10 short PlayerBlindness::current() const
11 {
12     return this->blindness;
13 }
14
15 bool PlayerBlindness::is_blind() const
16 {
17     return this->blindness > 0;
18 }
19
20 void PlayerBlindness::set(short value)
21 {
22     if (value < 0) {
23         THROW_EXCEPTION(std::invalid_argument, "Negative value can't be set in the player's blindness parameter!");
24     }
25
26     this->blindness = value;
27 }
28
29 void PlayerBlindness::reset()
30 {
31     this->set(0);
32 }