2015-05-03 22:02:39 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace ace {
|
2015-05-03 22:32:44 +00:00
|
|
|
namespace medical {
|
2015-05-03 22:02:39 +00:00
|
|
|
|
2015-05-03 22:32:44 +00:00
|
|
|
namespace injuries {
|
|
|
|
class DamageType;
|
|
|
|
class InjuryType;
|
|
|
|
class OpenWound;
|
|
|
|
}
|
2015-05-03 22:02:39 +00:00
|
|
|
|
2015-05-03 22:32:44 +00:00
|
|
|
class handleDamage
|
|
|
|
{
|
|
|
|
public:
|
2015-05-14 16:56:23 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static handleDamage& GetInstance();
|
2015-05-14 15:41:50 +00:00
|
|
|
|
2015-05-03 22:32:44 +00:00
|
|
|
~handleDamage();
|
2015-05-03 22:02:39 +00:00
|
|
|
|
2015-05-03 22:32:44 +00:00
|
|
|
/**
|
2015-05-17 07:48:59 +00:00
|
|
|
* Find new open wounds from advanced medical based upon the received damage.
|
2015-05-03 22:32:44 +00:00
|
|
|
*
|
2015-05-17 07:48:59 +00:00
|
|
|
* @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.
|
2015-05-03 22:32:44 +00:00
|
|
|
*/
|
2015-05-16 21:19:50 +00:00
|
|
|
std::string HandleDamageWounds(const std::string& selectionName, double amountOfDamage, const std::string& typeOfDamage, int woundID);
|
2015-05-03 22:02:39 +00:00
|
|
|
|
2015-05-03 22:32:44 +00:00
|
|
|
/**
|
2015-05-17 07:48:59 +00:00
|
|
|
* Find new open wounds from advanced medical based upon the received damage.
|
2015-05-03 22:32:44 +00:00
|
|
|
*
|
2015-05-17 07:48:59 +00:00
|
|
|
* @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.
|
2015-05-03 22:32:44 +00:00
|
|
|
*/
|
2015-05-17 07:48:59 +00:00
|
|
|
std::vector<ace::medical::injuries::OpenWound> GetInjuryInfoFor(const std::string& typeOfDamage, double amountOfDamage, int selection, int woundID);
|
2015-05-03 22:02:39 +00:00
|
|
|
|
2015-05-03 22:32:44 +00:00
|
|
|
/**
|
2015-05-17 07:48:59 +00:00
|
|
|
* Add a new damage type from extension input parameters
|
|
|
|
*
|
|
|
|
* @param sqfDamageTypeDefinition
|
|
|
|
* @return String with result of addition: ADDED [parameters] or FAILED
|
2015-05-03 22:32:44 +00:00
|
|
|
*/
|
2015-05-17 07:48:59 +00:00
|
|
|
std::string AddDamageType(const std::vector<std::string>& sqfDamageTypeDefinition);
|
2015-05-03 22:02:39 +00:00
|
|
|
|
2015-05-03 22:32:44 +00:00
|
|
|
/**
|
2015-05-17 07:48:59 +00:00
|
|
|
* Add a new injury type from extension input parameters
|
2015-05-03 22:32:44 +00:00
|
|
|
*
|
2015-05-17 07:48:59 +00:00
|
|
|
* @param sqfDamageTypeDefinition
|
|
|
|
* @return String with result of addition: ADDED [parameters] or FAILED
|
2015-05-03 22:32:44 +00:00
|
|
|
*/
|
2015-05-17 07:48:59 +00:00
|
|
|
std::string AddInjuryType(const std::vector<std::string>& sqfInjuryDefinition);
|
2015-05-03 22:02:39 +00:00
|
|
|
|
2015-05-03 22:32:44 +00:00
|
|
|
/**
|
2015-05-17 07:48:59 +00:00
|
|
|
* Convert a selectionName to a number
|
2015-05-03 22:32:44 +00:00
|
|
|
*
|
2015-05-17 07:48:59 +00:00
|
|
|
* @param selectionName
|
|
|
|
* @return number of selection
|
2015-05-03 22:32:44 +00:00
|
|
|
*/
|
2015-05-14 15:36:58 +00:00
|
|
|
int SelectionToNumber(const std::string& selectionName);
|
2015-05-03 22:02:39 +00:00
|
|
|
|
2015-05-03 22:32:44 +00:00
|
|
|
/**
|
2015-05-17 07:48:59 +00:00
|
|
|
* Lets the system know that all data has been added
|
2015-05-03 22:32:44 +00:00
|
|
|
*/
|
2015-05-17 07:48:59 +00:00
|
|
|
void FinalizeDefinitions();
|
2015-05-03 22:02:39 +00:00
|
|
|
|
2015-05-03 22:32:44 +00:00
|
|
|
private:
|
|
|
|
handleDamage();
|
2015-05-14 16:56:23 +00:00
|
|
|
|
|
|
|
handleDamage(handleDamage const&) = delete;
|
|
|
|
void operator=(handleDamage const&) = delete;
|
2015-05-14 15:41:50 +00:00
|
|
|
|
2015-05-16 21:19:50 +00:00
|
|
|
std::vector<std::string> inputToVector(const std::string& input);
|
|
|
|
std::vector<double> inputToVectorDouble(const std::string& input);
|
|
|
|
|
2015-05-14 15:36:58 +00:00
|
|
|
std::vector<std::shared_ptr<ace::medical::injuries::DamageType>> damageTypes;
|
|
|
|
std::vector<std::shared_ptr<ace::medical::injuries::InjuryType>> injuryTypes;
|
|
|
|
std::vector<std::string> selections;
|
|
|
|
std::vector<std::string> hitPoints;
|
2015-05-03 22:32:44 +00:00
|
|
|
};
|
|
|
|
}
|
2015-05-03 22:02:39 +00:00
|
|
|
}
|