double all the things (ints)

This commit is contained in:
Glowbal 2015-05-14 16:23:01 +02:00
parent 8ec57a985c
commit 7c03ec913b
9 changed files with 26 additions and 26 deletions

View File

@ -2,7 +2,7 @@
using namespace ace::medical;
injuries::DamageType::DamageType(std::string aTypeName, unsigned int minimalLethalDamage, unsigned int minDamage, unsigned int maxDamage)
injuries::DamageType::DamageType(std::string aTypeName, double minimalLethalDamage, double minDamage, double maxDamage)
: typeName(aTypeName), minLethalDamage(minimalLethalDamage), minDamageThreshold(minDamage), maxDamageThreshold(maxDamage)
{
}

View File

@ -11,13 +11,13 @@ namespace ace {
class DamageType
{
public:
DamageType(std::string aTypeName, unsigned int minimalLethalDamage, unsigned int minDamageThreshold, unsigned int maxDamageThreshold);
DamageType(std::string aTypeName, double minimalLethalDamage, double minDamageThreshold, double maxDamageThreshold);
~DamageType();
std::string typeName;
unsigned int minLethalDamage;
unsigned int minDamageThreshold;
unsigned int maxDamageThreshold;
double minLethalDamage;
double minDamageThreshold;
double maxDamageThreshold;
std::vector<std::shared_ptr<InjuryType>> possibleInjuries;
};

View File

@ -3,7 +3,7 @@
using namespace ace::medical;
injuries::InjuryType::InjuryType(signed int anId, const std::string& aClassname, std::vector<std::string>& allowedSelections, signed int theBloodLoss, signed int thePain, signed int minimumDamage, signed int maximumDamage, std::vector<std::string>& possibleCauses, std::string& aDisplayname)
injuries::InjuryType::InjuryType(signed int anId, const std::string& aClassname, std::vector<std::string>& allowedSelections, double theBloodLoss, double thePain, double minimumDamage, double maximumDamage, std::vector<std::string>& possibleCauses, std::string& aDisplayname)
: ID(anId), className(aClassname), selections(allowedSelections), bloodLoss(theBloodLoss), pain(thePain), minDamage(minimumDamage), maxDamage(maximumDamage), causes(possibleCauses), displayName(aDisplayname)
{
}

View File

@ -9,16 +9,16 @@ namespace ace {
class InjuryType
{
public:
InjuryType(signed int anId, const std::string& aClassname, std::vector<std::string>& allowedSelections, signed int theBloodLoss, signed int thePain, signed int minimumDamage, signed int maximumDamage, std::vector<std::string>& possibleCauses, std::string& aDisplayname);
InjuryType(signed int anId, const std::string& aClassname, std::vector<std::string>& allowedSelections, double theBloodLoss, double thePain, double minimumDamage, double maximumDamage, std::vector<std::string>& possibleCauses, std::string& aDisplayname);
~InjuryType();
signed int ID;
std::string className;
std::vector<std::string> selections;
signed int bloodLoss;
signed int pain;
signed int minDamage;
signed int maxDamage;
double bloodLoss;
double pain;
double minDamage;
double maxDamage;
std::vector<std::string> causes;
std::string displayName;
};

View File

@ -3,7 +3,7 @@
using namespace ace::medical;
injuries::OpenWound::OpenWound(unsigned int anID, unsigned int aBodyPart, unsigned int bloodloss) : classID(anID), bodyPart(aBodyPart), bloodlossRate(bloodloss)
injuries::OpenWound::OpenWound(double anID, double aBodyPart, double bloodloss) : classID(anID), bodyPart(aBodyPart), bloodlossRate(bloodloss)
{
}

View File

@ -8,14 +8,14 @@ namespace ace {
class OpenWound
{
public:
OpenWound(unsigned int anID, unsigned int aBodyPart, unsigned int bloodloss);
OpenWound(double anID, double aBodyPart, double bloodloss);
~OpenWound();
std::string AsString();
unsigned int classID;
unsigned int bodyPart;
unsigned int bloodlossRate;
double classID;
double bodyPart;
double bloodlossRate;
};
}

View File

@ -15,7 +15,7 @@ handleDamage::~handleDamage()
{
}
/* static */ std::vector<injuries::OpenWound> handleDamage::HandleDamageWounds(const std::string& selectionName, signed int amountOfDamage, const std::string& typeOfDamage)
/* static */ std::vector<injuries::OpenWound> handleDamage::HandleDamageWounds(const std::string& selectionName, double amountOfDamage, const std::string& typeOfDamage)
{
std::vector<injuries::OpenWound> wounds;
int selectionN = SelectionToNumber(selectionName);
@ -32,9 +32,9 @@ handleDamage::~handleDamage()
if (input.size() == 4)
{
std::string typeName = input[0];
unsigned int minimalLethalDamage = std::stod(input[1]);
unsigned int minDamageThreshold = std::stod(input[2]);
unsigned int maxDamageThreshold = std::stod(input[3]);
double minimalLethalDamage = std::stod(input[1]);
double minDamageThreshold = std::stod(input[2]);
double maxDamageThreshold = std::stod(input[3]);
std::shared_ptr<injuries::DamageType> type(new injuries::DamageType(typeName, minimalLethalDamage, minDamageThreshold, maxDamageThreshold));
damageTypes.push_back(type);
@ -50,11 +50,11 @@ handleDamage::~handleDamage()
int ID = std::stod(input[0]);
std::string className = input[1];
std::vector<std::string> allowedSelections; // input[2];
unsigned int bloodLoss = std::stod(input[3]);
unsigned int pain = std::stod(input[4]);
double bloodLoss = std::stod(input[3]);
double pain = std::stod(input[4]);
unsigned int minDamage = std::stod(input[5]);
unsigned int maxDamage = std::stod(input[6]);
double minDamage = std::stod(input[5]);
double maxDamage = std::stod(input[6]);
std::vector<std::string> possibleCauses; // input[7];
std::string displayName = input[8];

View File

@ -21,7 +21,7 @@ namespace ace {
/**
*
*/
static std::vector<injuries::OpenWound> HandleDamageWounds(const std::string& selectionName, signed int amountOfDamage, const std::string& typeOfDamage);
static std::vector<injuries::OpenWound> HandleDamageWounds(const std::string& selectionName, double amountOfDamage, const std::string& typeOfDamage);
/**
*

View File

@ -35,7 +35,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) {
else
{
std::vector<std::string> arguments = parseExtensionInput(function);
if (arguments.size > 0)
if (arguments.size() > 0)
{
std::string command = arguments.at(0);
// can we not just use C++11?