#include "GunProfile.h"

// Constructor implementation
GunProfile::GunProfile() {
  memset(_name, 0, sizeof(_name));
  _type = 0;
}
GunProfile::GunProfile(String name, int type) {
   memset(_name, 0, sizeof(_name));
   strncpy(_name, name.c_str(), sizeof(_name) - 1);
   _type=type;
}
String GunProfile::getName(){
  _name[sizeof(_name)-1] = '\0';
  for (int i = 0; i < sizeof(_name) - 1; i++) {
    if (_name[i] == '\0') { _name[i+1] = '\0'; break; }
  }
  return String(_name);
}
int GunProfile::getPowerLevel(){return _type;}