50 lines
1002 B
C++
50 lines
1002 B
C++
#include "Player.h"
|
|
|
|
static const int DAS_MIN_VALUE = 0; // 0ms
|
|
static const int DAS_MAX_VALUE = 30; // 500ms
|
|
static const int ARR_MIN_VALUE = 0; // 0ms
|
|
static const int ARR_MAX_VALUE = 30; // 500ms
|
|
static const int SDR_MIN_VALUE = 0; // 0ms
|
|
static const int SDR_MAX_VALUE = 6; // 100ms
|
|
|
|
|
|
Player::Player() {
|
|
// default settings
|
|
this->DAS = 15; // 250ms
|
|
this->ARR = 3; // 50ms
|
|
this->SDR = 2; // 33ms
|
|
}
|
|
|
|
bool Player::setDAS(int DAS) {
|
|
if (DAS < DAS_MIN_VALUE || DAS > DAS_MAX_VALUE) return false;
|
|
|
|
this->DAS = DAS;
|
|
return true;
|
|
}
|
|
|
|
bool Player::setARR(int ARR) {
|
|
if (ARR < ARR_MIN_VALUE || ARR > ARR_MAX_VALUE) return false;
|
|
|
|
this->ARR = ARR;
|
|
return true;
|
|
}
|
|
|
|
bool Player::setSDR(int SDR) {
|
|
if (SDR < SDR_MIN_VALUE || SDR > SDR_MAX_VALUE) return false;
|
|
|
|
this->SDR = SDR;
|
|
return true;
|
|
}
|
|
|
|
int Player::getDAS() const {
|
|
return this->DAS;
|
|
}
|
|
|
|
int Player::getARR() const {
|
|
return this->ARR;
|
|
}
|
|
|
|
int Player::getSDR() const {
|
|
return this->SDR;
|
|
}
|