Hello everyone, when i realised that one single .cpp file won't work for a game, i started to make an enemy class like this :
Code:
And the problem is, that enemy.h and enemy.cpp cannot use libraries, that is included in the main.cpp. So my question is, how to easily solve this problem, to avoid multiple header inclusion and so on..
And also, should i return *IAnimatedMeshSceneNode or just IAnimatedMeshSceneNode?
Code:
Enemy.h
#ifndef Enemy_h
#define Enemy_h
class Enemy {
irr::scene::IAnimatedMeshSceneNode Node;
public:
void setNode (irr::scene::IAnimatedMeshSceneNode *node);
irr::scene::IAnimatedMeshSceneNode getNode(void);
};
#endif
Enemy.cpp
#include "Enemy.h"
void Enemy::setNode(irr::scene::IAnimatedMeshSceneNode *node)
{
Node = node;
}
irr::scene::IAnimatedMeshSceneNode Enemy::getNode(void)
{
return Node;
}
Main.cpp
#include <irrlicht.h>
#include <windows.h>
#include <irrKlang.h>
#include <stdlib.h>
#include <time.h>
#include "Enemy.h"
#pragma comment(lib, "irrKlang.lib")
#pragma comment(lib, "Irrlicht.lib")
using namespace irr;
using namespace audio;
And the problem is, that enemy.h and enemy.cpp cannot use libraries, that is included in the main.cpp. So my question is, how to easily solve this problem, to avoid multiple header inclusion and so on..
And also, should i return *IAnimatedMeshSceneNode or just IAnimatedMeshSceneNode?