2020-08-13 20:53:35 +02:00
|
|
|
#include "HealthMessage.h"
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
|
|
void HealthMessage::setHealthMessage(CommandMessage* message, Command_t command,
|
|
|
|
HasHealthIF::HealthState health, HasHealthIF::HealthState oldHealth) {
|
|
|
|
message->setCommand(command);
|
|
|
|
message->setParameter(health);
|
|
|
|
message->setParameter2(oldHealth);
|
|
|
|
}
|
|
|
|
|
2020-10-29 17:52:28 +01:00
|
|
|
void HealthMessage::setHealthMessage(CommandMessage* message,
|
|
|
|
Command_t command) {
|
2016-06-15 23:48:41 +02:00
|
|
|
message->setCommand(command);
|
|
|
|
}
|
|
|
|
|
2020-10-29 17:52:28 +01:00
|
|
|
HasHealthIF::HealthState HealthMessage::getHealth(
|
|
|
|
const CommandMessage* message) {
|
2016-06-15 23:48:41 +02:00
|
|
|
return (HasHealthIF::HealthState) message->getParameter();
|
|
|
|
}
|
|
|
|
|
|
|
|
void HealthMessage::clear(CommandMessage* message) {
|
|
|
|
message->setCommand(CommandMessage::CMD_NONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
HealthMessage::HealthMessage() {
|
|
|
|
}
|
|
|
|
|
|
|
|
HasHealthIF::HealthState HealthMessage::getOldHealth(
|
|
|
|
const CommandMessage* message) {
|
|
|
|
return (HasHealthIF::HealthState) message->getParameter2();
|
|
|
|
}
|