C:\Users\Jared\Documents\Programs\EnemyList.h:13: error: 'Enemy' has not been declared
C:\Users\Jared\Documents\Programs\EnemyList.cpp: In constructor 'EnemyList::EnemyList()':
C:\Users\Jared\Documents\Programs\EnemyList.cpp:6: error: 'enemyList' was not declared in this scope
C:\Users\Jared\Documents\Programs\EnemyList.cpp:6: error: 'Enemy' was not declared in this scope
C:\Users\Jared\Documents\Programs\EnemyList.cpp:6: error: template argument 1 is invalid
C:\Users\Jared\Documents\Programs\EnemyList.cpp:6: error: template argument 2 is invalid
C:\Users\Jared\Documents\Programs\EnemyList.cpp: In destructor 'EnemyList::~EnemyList()':
C:\Users\Jared\Documents\Programs\EnemyList.cpp:11: error: 'enemyList' was not declared in this scope
C:\Users\Jared\Documents\Programs\EnemyList.cpp: At global scope:
C:\Users\Jared\Documents\Programs\EnemyList.cpp:14: error: variable or field 'addEnemy' declared void
C:\Users\Jared\Documents\Programs\EnemyList.cpp:14: error: 'Enemy' was not declared in this scope
C:\Users\Jared\Documents\Programs\EnemyList.cpp:18: error: variable or field 'removeEnemy' declared void
C:\Users\Jared\Documents\Programs\EnemyList.cpp:18: error: 'Enemy' was not declared in this scope
Not sure what the issue is, but I'm sure I'm gonna feel dumb when it's pointed out to me
Unless enemyList is a pointer to a vector, it doesn't make sense. you can do Enemy* enemies = new Enemy[x]; or std::vector<Enemy> enemies; or std::vector<Enemy*> enemies;
Ah I thought it would work similar to arrays. I changed it up and it works fine now.
The forward declaration brings up all sorts of errors though. Just including the enemy.h seems to work fine. Is there a reason to use one or the other?