mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
cross-platform compat integration for medical (history rewrite from gay merge).
This commit is contained in:
parent
c911645693
commit
f74eb31bbc
@ -3,6 +3,7 @@
|
|||||||
#include "DamageType.h"
|
#include "DamageType.h"
|
||||||
#include "InjuryType.h"
|
#include "InjuryType.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
namespace ace {
|
namespace ace {
|
||||||
namespace medical {
|
namespace medical {
|
||||||
@ -59,11 +60,11 @@ namespace ace {
|
|||||||
std::vector<std::shared_ptr<ace::medical::injuries::InjuryType>> information;
|
std::vector<std::shared_ptr<ace::medical::injuries::InjuryType>> information;
|
||||||
std::shared_ptr<ace::medical::injuries::InjuryType> highestSpot = nullptr;
|
std::shared_ptr<ace::medical::injuries::InjuryType> highestSpot = nullptr;
|
||||||
|
|
||||||
for each (std::shared_ptr<ace::medical::injuries::DamageType> damageType in damageTypes)
|
for (auto & damageType : damageTypes)
|
||||||
{
|
{
|
||||||
if (damageType->typeName == typeOfDamage)
|
if (damageType->typeName == typeOfDamage)
|
||||||
{
|
{
|
||||||
for each (std::shared_ptr<ace::medical::injuries::InjuryType> possibleInjury in damageType->possibleInjuries)
|
for (auto & possibleInjury : damageType->possibleInjuries)
|
||||||
{
|
{
|
||||||
if (amountOfDamage >= possibleInjury->minDamage && (amountOfDamage <= possibleInjury->maxDamage || possibleInjury->maxDamage <= 0))
|
if (amountOfDamage >= possibleInjury->minDamage && (amountOfDamage <= possibleInjury->maxDamage || possibleInjury->maxDamage <= 0))
|
||||||
{
|
{
|
||||||
@ -81,7 +82,7 @@ namespace ace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int c = 0;
|
int c = 0;
|
||||||
for each (double threshold in damageType->minDamageThreshold)
|
for (double & threshold : damageType->minDamageThreshold)
|
||||||
{
|
{
|
||||||
if (amountOfDamage >= threshold)
|
if (amountOfDamage >= threshold)
|
||||||
{
|
{
|
||||||
@ -132,12 +133,12 @@ namespace ace {
|
|||||||
std::stringstream stream;
|
std::stringstream stream;
|
||||||
|
|
||||||
stream << "ADDED: " << typeName << " - " << minimalLethalDamage << " - [";
|
stream << "ADDED: " << typeName << " - " << minimalLethalDamage << " - [";
|
||||||
for each (double sel in minDamageThreshold)
|
for (double & sel : minDamageThreshold)
|
||||||
{
|
{
|
||||||
stream << sel << " -";
|
stream << sel << " -";
|
||||||
}
|
}
|
||||||
stream << "] - [";
|
stream << "] - [";
|
||||||
for each (double sel in amountOfInjuresOnDamage)
|
for (double & sel : amountOfInjuresOnDamage)
|
||||||
{
|
{
|
||||||
stream << sel << " -";
|
stream << sel << " -";
|
||||||
}
|
}
|
||||||
@ -167,13 +168,13 @@ namespace ace {
|
|||||||
std::stringstream stream;
|
std::stringstream stream;
|
||||||
|
|
||||||
stream << "ADDED: " << ID << " - " << className << " - [";
|
stream << "ADDED: " << ID << " - " << className << " - [";
|
||||||
for each (std::string sel in allowedSelections)
|
for (std::string & sel : allowedSelections)
|
||||||
{
|
{
|
||||||
stream << sel << " -";
|
stream << sel << " -";
|
||||||
}
|
}
|
||||||
stream << "] - ";
|
stream << "] - ";
|
||||||
stream << bloodLoss << " - " << pain << " - " << minDamage << " - " << maxDamage;
|
stream << bloodLoss << " - " << pain << " - " << minDamage << " - " << maxDamage;
|
||||||
for each (std::string sel in possibleCauses)
|
for (std::string & sel : possibleCauses)
|
||||||
{
|
{
|
||||||
stream << sel << " -";
|
stream << sel << " -";
|
||||||
}
|
}
|
||||||
@ -186,11 +187,11 @@ namespace ace {
|
|||||||
void handleDamage::FinalizeDefinitions()
|
void handleDamage::FinalizeDefinitions()
|
||||||
{
|
{
|
||||||
// We are finding all possible injuries for a specific damage type here, so we don't have to figure that out at a later stage.
|
// We are finding all possible injuries for a specific damage type here, so we don't have to figure that out at a later stage.
|
||||||
for each (std::shared_ptr<ace::medical::injuries::DamageType> damageType in damageTypes)
|
for (auto & damageType : damageTypes)
|
||||||
{
|
{
|
||||||
for each (std::shared_ptr<ace::medical::injuries::InjuryType> injuryType in injuryTypes)
|
for (auto & injuryType : injuryTypes)
|
||||||
{
|
{
|
||||||
std::vector<std::string>::iterator it = find(injuryType->causes.begin(), injuryType->causes.end(), damageType->typeName);
|
std::vector<std::string>::iterator it = std::find(injuryType->causes.begin(), injuryType->causes.end(), damageType->typeName);
|
||||||
// outputstream << " Evaluating causes: " << (it != injuryType->causes.end()) << " ";
|
// outputstream << " Evaluating causes: " << (it != injuryType->causes.end()) << " ";
|
||||||
if (it != injuryType->causes.end())
|
if (it != injuryType->causes.end())
|
||||||
{
|
{
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* Glowbal
|
* Glowbal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ace_common.h"
|
#include "shared.hpp"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
#include "OpenWound.h"
|
#include "OpenWound.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
__declspec (dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function);
|
EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function);
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<std::string> parseExtensionInput(const std::string& input)
|
std::vector<std::string> parseExtensionInput(const std::string& input)
|
||||||
|
Loading…
Reference in New Issue
Block a user