mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-03 17:46:36 +00:00
[Strings] Add more number formatters (#2873)
* [Strings] Add more number formatters # Notes - Adds `Strings::ToUnsignedInt` for `uint32` support. - Adds `Strings::ToBigInt` for `int64` support. - Adds `Strings::ToUnsignedBigInt` for `uint64` support. - Adds `Strings::ToFloat` for `float` support. - Replaces all `std::stoi` references with `Strings::ToInt`. - Replaces all `atoi` references with `Strings::ToInt`. - Replaces all `std::stoul` references with `Strings::ToUnsignedInt`. - Replaces all `atoul` references with `Strings::ToUnsignedInt`. - Replaces all `std::stoll` references with `Strings::ToBigInt`. - Replaces all `atoll` references with `Strings::ToBigInt`. - Replaces all `std::stoull` references with `Strings::ToUnsignedBigInt`. - Replaces all `atoull` references with `Strings::ToUnsignedBigInt`. - Replaces all `std::stof` references with `Strings::ToFloat`. * [Strings] Add more number formatters - Adds `Strings::ToUnsignedInt` for `uint32` support. - Adds `Strings::ToBigInt` for `int64` support. - Adds `Strings::ToUnsignedBigInt` for `uint64` support. - Adds `Strings::ToFloat` for `float` support. - Replaces all `std::stoi` references with `Strings::ToInt`. - Replaces all `atoi` references with `Strings::ToInt`. - Replaces all `std::stoul` references with `Strings::ToUnsignedInt`. - Replaces all `atoul` references with `Strings::ToUnsignedInt`. - Replaces all `std::stoll` references with `Strings::ToBigInt`. - Replaces all `atoll` references with `Strings::ToBigInt`. - Replaces all `std::stoull` references with `Strings::ToUnsignedBigInt`. - Replaces all `atoull` references with `Strings::ToUnsignedBigInt`. - Replaces all `std::stof` references with `Strings::ToFloat`. * Rebase cleanup * Changes/benchmarks/tests --------- Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
+20
-20
@@ -197,11 +197,11 @@ void command_tune(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
if (!strcasecmp(sep->arg[1], "FindATK")) {
|
||||
float pct_mitigation = atof(sep->arg[3]);
|
||||
int interval = atoi(sep->arg[4]);
|
||||
int max_loop = atoi(sep->arg[5]);
|
||||
int ac_override = atoi(sep->arg[6]);
|
||||
int info_level = atoi(sep->arg[7]);
|
||||
float pct_mitigation = Strings::ToFloat(sep->arg[3]);
|
||||
int interval = Strings::ToInt(sep->arg[4]);
|
||||
int max_loop = Strings::ToInt(sep->arg[5]);
|
||||
int ac_override = Strings::ToInt(sep->arg[6]);
|
||||
int info_level = Strings::ToInt(sep->arg[7]);
|
||||
|
||||
if (!pct_mitigation) {
|
||||
c->Message(Chat::White, "[#Tune] - Error must enter the desired percent mitigation on defender.");
|
||||
@@ -277,11 +277,11 @@ void command_tune(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
if (!strcasecmp(sep->arg[1], "FindAC")) {
|
||||
float pct_mitigation = atof(sep->arg[3]);
|
||||
int interval = atoi(sep->arg[4]);
|
||||
int max_loop = atoi(sep->arg[5]);
|
||||
int atk_override = atoi(sep->arg[6]);
|
||||
int info_level = atoi(sep->arg[7]);
|
||||
float pct_mitigation = Strings::ToFloat(sep->arg[3]);
|
||||
int interval = Strings::ToInt(sep->arg[4]);
|
||||
int max_loop = Strings::ToInt(sep->arg[5]);
|
||||
int atk_override = Strings::ToInt(sep->arg[6]);
|
||||
int info_level = Strings::ToInt(sep->arg[7]);
|
||||
|
||||
if (!pct_mitigation) {
|
||||
c->Message(Chat::White, "#Tune - Error must enter the desired percent mitigation on defender.");
|
||||
@@ -358,11 +358,11 @@ void command_tune(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
if (!strcasecmp(sep->arg[1], "FindAccuracy")) {
|
||||
float hit_chance = atof(sep->arg[3]);
|
||||
int interval = atoi(sep->arg[4]);
|
||||
int max_loop = atoi(sep->arg[5]);
|
||||
int avoid_override = atoi(sep->arg[6]);
|
||||
int info_level = atoi(sep->arg[7]);
|
||||
float hit_chance = Strings::ToFloat(sep->arg[3]);
|
||||
int interval = Strings::ToInt(sep->arg[4]);
|
||||
int max_loop = Strings::ToInt(sep->arg[5]);
|
||||
int avoid_override = Strings::ToInt(sep->arg[6]);
|
||||
int info_level = Strings::ToInt(sep->arg[7]);
|
||||
|
||||
if (!hit_chance) {
|
||||
c->Message(Chat::White, "#Tune - Error must enter the desired hit chance on defender.");
|
||||
@@ -439,11 +439,11 @@ void command_tune(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
if (!strcasecmp(sep->arg[1], "FindAvoidance")) {
|
||||
float hit_chance = atof(sep->arg[3]);
|
||||
int interval = atoi(sep->arg[4]);
|
||||
int max_loop = atoi(sep->arg[5]);
|
||||
int acc_override = atoi(sep->arg[6]);
|
||||
int info_level = atoi(sep->arg[7]);
|
||||
float hit_chance = Strings::ToFloat(sep->arg[3]);
|
||||
int interval = Strings::ToInt(sep->arg[4]);
|
||||
int max_loop = Strings::ToInt(sep->arg[5]);
|
||||
int acc_override = Strings::ToInt(sep->arg[6]);
|
||||
int info_level = Strings::ToInt(sep->arg[7]);
|
||||
|
||||
if (!hit_chance) {
|
||||
c->Message(Chat::White, "#Tune - Error must enter the desired hit chance on defender.");
|
||||
|
||||
Reference in New Issue
Block a user