mirror of
https://github.com/QuasarApp/Heart.git
synced 2025-05-20 05:19:42 +00:00
33 lines
681 B
C++
33 lines
681 B
C++
|
#include "networkclasssize.h"
|
||
|
|
||
|
namespace ClientProtocol {
|
||
|
|
||
|
bool NetworkClassSize::isStaticType() {
|
||
|
return min == max;
|
||
|
}
|
||
|
|
||
|
NetworkClassSize::NetworkClassSize(unsigned int size) {
|
||
|
operator=(size);
|
||
|
}
|
||
|
|
||
|
NetworkClassSize::NetworkClassSize(unsigned int min, unsigned int maxDif) {
|
||
|
operator=(min);
|
||
|
max += maxDif;
|
||
|
}
|
||
|
|
||
|
NetworkClassSize &NetworkClassSize::operator =(unsigned int size) {
|
||
|
min = max = size;
|
||
|
return *this;
|
||
|
}
|
||
|
|
||
|
NetworkClassSize &NetworkClassSize::operator +(const NetworkClassSize & other) {
|
||
|
min += other.min;
|
||
|
max += other.max;
|
||
|
return *this;
|
||
|
}
|
||
|
|
||
|
bool NetworkClassSize::isValid(unsigned int size) const {
|
||
|
return size <= max && size >= min;
|
||
|
}
|
||
|
}
|