From 2544cdef4ae78487d0a51a2fb00b68fa204c5cb4 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 17 May 2015 09:48:59 +0200 Subject: [PATCH] Clean up --- extensions/medical/handleDamage.cpp | 9 +------ extensions/medical/handleDamage.h | 41 +++++++++++++++++++---------- extensions/medical/medical.cpp | 3 +-- 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/extensions/medical/handleDamage.cpp b/extensions/medical/handleDamage.cpp index f6756072d7..0cd31dd273 100644 --- a/extensions/medical/handleDamage.cpp +++ b/extensions/medical/handleDamage.cpp @@ -50,7 +50,6 @@ namespace ace { return stream.str(); } - stream << ""; return stream.str(); } @@ -152,8 +151,6 @@ namespace ace { { if (input.size() == 9) { - // TODO parse arrays from string input - int ID = std::stod(input[0]); std::string className = input[1]; std::vector allowedSelections = inputToVector(input[2]); @@ -186,10 +183,8 @@ namespace ace { return "failed"; } - std::string handleDamage::FinalizeDefinitions() + void handleDamage::FinalizeDefinitions() { - std::stringstream outputstream; - // 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 damageType in damageTypes) { @@ -202,9 +197,7 @@ namespace ace { damageType->possibleInjuries.push_back(injuryType); } } - outputstream << " ---- For: " << damageType->typeName << " Added: " << damageType->possibleInjuries.size() << " --- "; } - return outputstream.str(); } int handleDamage::SelectionToNumber(const std::string& selectionName) diff --git a/extensions/medical/handleDamage.h b/extensions/medical/handleDamage.h index 650f677445..3b2cd739c8 100644 --- a/extensions/medical/handleDamage.h +++ b/extensions/medical/handleDamage.h @@ -24,42 +24,55 @@ namespace ace { ~handleDamage(); /** + * Find new open wounds from advanced medical based upon the received damage. * + * @param selectionName A string representation of the bodypart (for example: leg_r) + * @param amountOfDamage The damage received + * @param typeOfDamage The type of the damage received + * @param woundID latest wound ID + * @return SQF string containing _woundsCreated and _painAdded. */ std::string HandleDamageWounds(const std::string& selectionName, double amountOfDamage, const std::string& typeOfDamage, int woundID); + /** + * Find new open wounds from advanced medical based upon the received damage. + * + * @param typeOfDamage The type of the damage received + * @param amountOfDamage The damage received + * @param selection A number representation of the bodypart. Number from 0 to 6. + * @param woundID latest wound ID + * @return New open wounds. + */ std::vector GetInjuryInfoFor(const std::string& typeOfDamage, double amountOfDamage, int selection, int woundID); /** - * + * Add a new damage type from extension input parameters + * + * @param sqfDamageTypeDefinition + * @return String with result of addition: ADDED [parameters] or FAILED */ std::string AddDamageType(const std::vector& sqfDamageTypeDefinition); /** + * Add a new injury type from extension input parameters * + * @param sqfDamageTypeDefinition + * @return String with result of addition: ADDED [parameters] or FAILED */ std::string AddInjuryType(const std::vector& sqfInjuryDefinition); /** + * Convert a selectionName to a number * - */ - //static std::string SetInjuryTypeData(const std::string& data); - - - /** - * + * @param selectionName + * @return number of selection */ int SelectionToNumber(const std::string& selectionName); /** - * + * Lets the system know that all data has been added */ - //static std::vector> GetInjuryInfoFor(const std::string& damageType); - - /** - * - */ - std::string FinalizeDefinitions(); + void FinalizeDefinitions(); private: handleDamage(); diff --git a/extensions/medical/medical.cpp b/extensions/medical/medical.cpp index 9a93060b2e..4f25472e26 100644 --- a/extensions/medical/medical.cpp +++ b/extensions/medical/medical.cpp @@ -35,7 +35,6 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) { } else { - std::string returnValue = ""; std::vector arguments = parseExtensionInput(function); if (arguments.size() > 0) @@ -59,7 +58,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) { } } else if (command == "ConfigComplete") { - returnValue = ace::medical::handleDamage::GetInstance().FinalizeDefinitions(); + ace::medical::handleDamage::GetInstance().FinalizeDefinitions(); } } strncpy(output, returnValue.c_str(), outputSize);