#include "Unit.h"
#include <string.h>
#include <stdio.h>

unsigned int Unit :: num_of_units = 0;

Unit :: Unit() {
	this->id = num_of_units;
	num_of_units++;
	set_name(NO_NAME);
}

Unit :: Unit(char* name) {
	this->id = num_of_units;
	num_of_units++;
	set_name(name);
}

void Unit :: set_id(unsigned int id) {
	this->id = id;
}

unsigned int Unit :: get_id() {
	return this->id;
}

void Unit :: set_name(char* name) {
	strncpy_s (this->name, name, MAX_LENGTH_NAME);
}

char* Unit :: get_name() {
	return this->name;
}