International Journal of Computer Games Technology / 2015 / Article / Alg 12

Research Article

Artificial Intelligence in Video Games: Towards a Unified Framework

Algorithm 12

Synchronization with virtual classes. The virtual class MovingEntity uses a pure virtual getter implemented by its concrete subclass Raven_Bot for its synchronization code.
class  MovingEntity:  public  BaseGameEntity
{
 //Virtual accessor − Retrieves the conceptual projection of this entity
virtual  CptMvEntity2D  GetCptMvEntity2D()  const  = 0;
void  SetVelocity(const  Vector2D &  NewVel)
{
m_vVelocity = NewVel;
  //Velocity changed, update conceptual data
GetCptMvEntity2D()->SetVelocity(m_vVelocity);
}
}
class  Raven_Bot:  public  MovingEntity
{
protected:
 //The conceptual projection
CptMvAgent2D  cpt;
public:
 //Returns the entire conceptual projection of this bot
CptMvAgent2D  GetCptMvAgent2D()  const  {  return  cpt; }
 //Returns the conceptual projection of the MovingEntity part of this bot
CptMvEntity2D  GetCptMvEntity2D()  const  {  return  cpt; }
 //Returns the conceptual projection of the BaseGameEntity part of this bot
CptEntity2D  GetCptEntity2D()  const  {  return  cpt; }
}

We are committed to sharing findings related to COVID-19 as quickly as possible. We will be providing unlimited waivers of publication charges for accepted research articles as well as case reports and case series related to COVID-19. Review articles are excluded from this waiver policy. Sign up here as a reviewer to help fast-track new submissions.