aboutsummaryrefslogtreecommitdiff
path: root/backend/Enemy.cpp
blob: 699a3037773c19e301584fd55dc612c07ff7aad3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <string.h>

#include "Enemy.h"
#include "util.h"

Enemy::Enemy(const char * name, const char * description) {
	this->set_name(name);
	this->set_description(description);
}

Enemy::~Enemy() {
	safe_free(this->name);
	safe_free(this->description);
}

void Enemy::set_name(const char * name) {
	safe_free(this->name);
	this->name = strdup(name);
}
const char * Enemy::get_name() {
	return this->name;
}

void Enemy::set_description(const char * description) {
	safe_free(this->description);
	this->description = strdup(description);
}
const char * Enemy::get_description() {
	return this->description;
}