aim: look at last enemy origin when just loosed focus

fix: saving bot practice took enormous amount of time when changing level on large practice database
refactor: changed random number generator usage
This commit is contained in:
jeefo 2024-04-25 15:03:39 +03:00
commit 3358168fad
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
27 changed files with 588 additions and 581 deletions

View file

@ -193,25 +193,25 @@ public:
m_printQueueFlushTimestamp = 0.0f;
}
int intValue (size_t arg) const {
if (!hasArg (arg)) {
return 0;
template <typename U> constexpr U arg (const size_t index) const {
if constexpr (cr::is_same <U, float>::value) {
if (!hasArg (index)) {
return 0.0f;
}
return m_args[index].as <float> ();
}
return m_args[arg].int_ ();
}
float floatValue (size_t arg) const {
if (!hasArg (arg)) {
return 0.0f;
else if constexpr (cr::is_same <U, int>::value) {
if (!hasArg (index)) {
return 0;
}
return m_args[index].as <int> ();
}
return m_args[arg].float_ ();
}
StringRef strValue (size_t arg) {
if (!hasArg (arg)) {
return "";
else if constexpr (cr::is_same <U, StringRef>::value) {
if (!hasArg (index)) {
return "";
}
return m_args[index];
}
return m_args[arg];
}
bool hasArg (size_t arg) const {