CPP03/ex02/inc/ClapTrap.hpp
2025-04-08 10:24:03 +02:00

59 lines
1.9 KiB
C++

/* ************************************************************************** */
/* */
/* :::::::: */
/* ClapTrap.hpp :+: :+: */
/* +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2025/03/27 16:26:32 by whaffman #+# #+# */
/* Updated: 2025/04/08 10:19:00 by whaffman ######## odam.nl */
/* */
/* ************************************************************************** */
#pragma once
#include <string>
#define BOLD_UNDERLINE "\033[1;4m"
#define COLOR0 "\033[38;5;0m"
#define COLOR1 "\033[38;5;1m"
#define COLOR2 "\033[38;5;2m"
#define COLOR3 "\033[38;5;3m"
#define COLOR4 "\033[38;5;4m"
#define COLOR5 "\033[38;5;5m"
#define COLOR6 "\033[38;5;6m"
#define COLOR7 "\033[38;5;7m"
#define COLOR8 "\033[38;5;8m"
#define COLOR9 "\033[38;5;9m"
#define COLOR10 "\033[38;5;10m"
#define COLOR11 "\033[38;5;11m"
#define COLOR12 "\033[38;5;12m"
#define COLOR13 "\033[38;5;13m"
#define COLOR14 "\033[38;5;14m"
#define COLOR15 "\033[38;5;15m"
#define COLOR_RESET "\033[m"
class ClapTrap
{
protected:
std::string _name;
int _hitpoints;
int _energy_points;
int _attack_damage;
public:
ClapTrap();
ClapTrap(std::string name);
ClapTrap(ClapTrap const &src);
~ClapTrap();
ClapTrap &operator=(ClapTrap const &other);
void status() const;
void attack(std::string const &target);
void takeDamage(unsigned int amount);
void beRepaired(unsigned int amount);
};
void claptrap_test();