I've a project in C++ with 2 classes.
MAIN.CPP:
#include <iostream>
#include <conio.h>
#include "Player.h"
#include "Enemy.h"
using namespace std;
int main()
{
const int startHealth = 100, startArmor = 50, startEnemyHealth = 70, startWeapon = 1;
Player *Mick = new Player(startHealth, startArmor, startWeapon);
Enemy *Mon = new Enemy(startEnemyHealth);
cout << "START!" << endl;
cout << Mick->Health << " : " << Mick->Armor << endl;
cout << "ENEMY ATTACKS!" << endl;
Mon->Attack(Mick);
cout << "DAMAGE TAKEN!" << endl;
cout << Mick->Health << " : " << Mick->Armor << endl;
cout << "YOU ATTACK!" << endl;
Mick->Attack(Mon);
cout << "ENEMY'S HEALTH!" << endl;
cout << Mon->Health << endl;
_getch();
return 0;
}
PLAYER.H
#pragma once
#include "Enemy.h"
class Player
{
public:
int Health, Armor;
int Weapon;
public:
Player(const int _startHealth, const int _startArmor, const int _startWeapon);
~Player();
void Attack(Enemy *_attackedEnemy);
};
ENEMY.H
#pragma once
#include "Player.h"
class Enemy
{
public:
float Speed;
int Damage;
int Health;
public:
Enemy(const int _startEnemyHealth);
~Enemy();
void Attack(Player *_attackedPlayer);
void Refresh(Enemy *_enemyToRefresh);
};
The errors that I get are these ones:
Meanwhile, these are the errors that CodeBlocks gives me:
Can someone help me with this issue?