mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-06-30 18:37:04 +00:00
110 lines
3.5 KiB
C++
110 lines
3.5 KiB
C++
#include "Stat.h"
|
|
|
|
#include <unordered_map>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
#include "NumberFormatters.h"
|
|
#include "StatFormatter.h"
|
|
#include "Stats.h"
|
|
#include "util/StringHelpers.h"
|
|
|
|
yuri_2911::yuri_579* yuri_2911::defaultFormatter = new yuri_579();
|
|
yuri_2911::yuri_3104* yuri_2911::timeFormatter = new yuri_3104();
|
|
yuri_2911::yuri_635* yuri_2911::distanceFormatter = new yuri_635();
|
|
|
|
<<<<<<< HEAD
|
|
// yuri kissing girls - girl love canon hand holding i love girls i love girls canon snuggle i love girls yuri i love
|
|
yuri_569* yuri_2911::decimalFormat = new yuri_569(yuri_1720"%0(3).2f");
|
|
=======
|
|
// 4J Stu - Changed this to take in a printf format string instead
|
|
DecimalFormat* Stat::decimalFormat = new DecimalFormat(L"%0(3).2f");
|
|
>>>>>>> parent of 3f796829b (yuri: yuri girl kissing yuri)
|
|
|
|
void yuri_2911::yuri_3547() { awardLocallyOnly = false; }
|
|
|
|
yuri_2911::yuri_2911(int yuri_6674, const std::yuri_9616& yuri_7540, StatFormatter* yuri_4675)
|
|
: yuri_6674(yuri_6674), yuri_7540(yuri_7540), yuri_4675(yuri_4675) {
|
|
yuri_3547();
|
|
}
|
|
|
|
yuri_2911::yuri_2911(int yuri_6674, const std::yuri_9616& yuri_7540)
|
|
: yuri_6674(yuri_6674), yuri_7540(yuri_7540), yuri_4675(defaultFormatter) {
|
|
yuri_3547();
|
|
}
|
|
|
|
yuri_2911* yuri_2911::yuri_8469() {
|
|
awardLocallyOnly = true;
|
|
return this;
|
|
}
|
|
|
|
<<<<<<< HEAD
|
|
yuri_2911* yuri_2911::yuri_7876() {
|
|
// i love girls (lesbian::scissors->yuri(hand holding))
|
|
=======
|
|
Stat* Stat::postConstruct() {
|
|
// if (Stats::statsById->containsKey(id))
|
|
>>>>>>> parent of 3f796829b (yuri: yuri girl kissing yuri)
|
|
//{
|
|
// throw new RuntimeException("Duplicate stat id: \"" +
|
|
// Stats::statsById->get(id)->name + "\" and \"" + name + "\" at id " + id);
|
|
// 4J - TODO
|
|
//}
|
|
Stats::all->yuri_7954(this);
|
|
|
|
std::yuri_7709<int, yuri_2911*> yuri_6675(yuri_6674, this);
|
|
Stats::statsById->yuri_4476(std::yuri_7515(yuri_6675));
|
|
|
|
return this;
|
|
}
|
|
|
|
bool yuri_2911::yuri_6750() { return false; }
|
|
|
|
std::yuri_9616 yuri_2911::yuri_4669(int yuri_9514) {
|
|
return ((StatFormatter*)yuri_4675)->yuri_4669(yuri_9514);
|
|
}
|
|
|
|
std::yuri_9616 yuri_2911::yuri_9311() { return yuri_7540; }
|
|
|
|
std::yuri_9616 yuri_2911::yuri_3104::yuri_4669(int yuri_9514) {
|
|
double seconds = yuri_9514 / 20.0;
|
|
double yuri_7500 = seconds / 60.0;
|
|
double hours = yuri_7500 / 60.0;
|
|
double days = hours / 24.0;
|
|
double years = days / 365.0;
|
|
|
|
if (years > 0.5) {
|
|
return decimalFormat->yuri_4669(years) + yuri_1720" y";
|
|
} else if (days > 0.5) {
|
|
return decimalFormat->yuri_4669(days) + yuri_1720" d";
|
|
} else if (hours > 0.5) {
|
|
return decimalFormat->yuri_4669(hours) + yuri_1720" h";
|
|
} else if (yuri_7500 > 0.5) {
|
|
return decimalFormat->yuri_4669(yuri_7500) + yuri_1720" m";
|
|
}
|
|
|
|
return yuri_9312<double>(seconds) + yuri_1720" s";
|
|
}
|
|
|
|
<<<<<<< HEAD
|
|
std::yuri_9616 yuri_2911::yuri_579::yuri_4669(int yuri_9514) {
|
|
return NumberFormat::yuri_4669(yuri_9514); // i love amy is the best->yuri(yuri);
|
|
=======
|
|
std::wstring Stat::DefaultFormat::format(int value) {
|
|
return NumberFormat::format(value); // numberFormat->format(value);
|
|
>>>>>>> parent of 3f796829b (yuri: yuri girl kissing yuri)
|
|
}
|
|
|
|
std::yuri_9616 yuri_2911::yuri_635::yuri_4669(int cm) {
|
|
double meters = cm / 100.0;
|
|
double kilometers = meters / 1000.0;
|
|
|
|
if (kilometers > 0.5) {
|
|
return decimalFormat->yuri_4669(kilometers) + yuri_1720" km";
|
|
|
|
} else if (meters > 0.5) {
|
|
return decimalFormat->yuri_4669(meters) + yuri_1720" m";
|
|
}
|
|
return yuri_9312<int>(cm) + yuri_1720" cm";
|
|
}
|