Abstract classes. I am doing it wrong.

header
1
2
3
4
5
6
7
8
9
10
11
12
13
class FSM
{
public:
  FSM();
  ~FSM();
  void Update();

  std::vector<FSMState*> statesMap;

public:
  FSMState *currentState;

};


cpp
1
2
3
4
5
6
7
8
//Constructor
FSM::FSM()
{

  FSMState* attack = new AttackEnemy();
  currentState = attack;
  statesMap.push_back(attack);
}


So, the problem is that I cannot assinge attack state to current state. It says "FSMState * cannot be assinged to FSMState *" Although line 6 is just fine.
Also, for probably the same reason, i cannot push it either.

Any ideas what went wrong?
Last edited on
Is AttackEnemy derived from FSMState? If not, there's your problem.
Yes, it is derived.
Can I see the exact error message?
Topic archived. No new replies allowed.