title: Basic C++ class how to implement with Objective C
body: <p>I have some problems with implementing class which written in C++, because I not familiar with c++ .. if someone could help with implementing it in Objective C</p>
  
  <pre><code>#ifndef ENTITY_H
  #define ENTITY_H
  
  class BaseGameEntity
  {
  
  private:
  
    int          m_ID;
    static int  m_iNextValidID;
  
    void SetID(int val);
  
  public:
  
    BaseGameEntity(int id)
    {
      SetID(id);
    }
  
    virtual ~BaseGameEntity(){}
  
    virtual void  Update()=0;
  
    int           ID()const{return m_ID;}  
  };
  
  
  
  #endif
  
  
  #include "BaseGameEntity.h"
  #include &lt;cassert&gt;
  
  int BaseGameEntity::m_iNextValidID = 0;
  
  void BaseGameEntity::SetID(int val)
  {
    assert ( (val &gt;= m_iNextValidID) &amp;&amp; "&lt;BaseGameEntity::SetID&gt;: invalid ID");
  
    m_ID = val;
  
    m_iNextValidID = m_ID + 1;
  }
  </code></pre>