Skip to main content
edited body
Source Link
Jay
  • 810
  • 5
  • 14

In this case you want to use virtual functions on the base class like so:

class Entity // base class
{
  virtual void ai(Entity n){}
}

Even though this is just example code, I can see that it might cause problems because you are passing by value instead of myby reference.

In this case you want to use virtual functions on the base class like so:

class Entity // base class
{
  virtual void ai(Entity n){}
}

Even though this is just example code, I can see that it might cause problems because you are passing by value instead of my reference.

In this case you want to use virtual functions on the base class like so:

class Entity // base class
{
  virtual void ai(Entity n){}
}

Even though this is just example code, I can see that it might cause problems because you are passing by value instead of by reference.

Source Link
Jay
  • 810
  • 5
  • 14

In this case you want to use virtual functions on the base class like so:

class Entity // base class
{
  virtual void ai(Entity n){}
}

Even though this is just example code, I can see that it might cause problems because you are passing by value instead of my reference.