class Entity {
private:
string m_Name;
int x, y, z;
public: //初始化列表的两种方式,另外一种是注释中的内容
Entity() :m_Name("unknown"),x(0),y(0),z(0) {}
Entity(const string &name) :m_Name(name), x(0), y(0), z(0) {}
/*Entity(){ //初始化列表的第二种方式
m_Name = "unknown";
}
Entity(string &name) {
m_Name = name;
}*/
string GetName() {
return m_Name;
};
};