66 |
|
|
67 |
bool string_attrib(const string &name, string *val) const; |
bool string_attrib(const string &name, string *val) const; |
68 |
int int_attrib(const string &name) const; |
int int_attrib(const string &name) const; |
69 |
|
bool int_attrib(const string &name, int *val) const; |
70 |
bool double_attrib (const string &name, double *val) const; |
bool double_attrib (const string &name, double *val) const; |
71 |
|
|
72 |
virtual Object *clone()=0; |
virtual Object *clone()=0; |
73 |
virtual void dispose()=0; |
virtual void dispose()=0; |
74 |
|
virtual void init() {} |
75 |
|
|
76 |
const string &get_kind() const { return kind_; } |
const string &get_kind() const { return kind_; } |
77 |
private: |
private: |
270 |
virtual bool is_dead() = 0; |
virtual bool is_dead() = 0; |
271 |
virtual bool is_flying() { return false; } |
virtual bool is_flying() { return false; } |
272 |
|
|
273 |
|
// Object interface. |
274 |
|
void init(); |
275 |
|
|
276 |
// Accessors. |
// Accessors. |
277 |
world::ActorInfo *get_actorinfo() { return &actorinfo; } |
world::ActorInfo *get_actorinfo() { return &actorinfo; } |
278 |
const px::V3 &get_pos() const { return actorinfo.pos; } |
const px::V3 &get_pos() const { return actorinfo.pos; } |
287 |
actorinfo.forceacc += f; |
actorinfo.forceacc += f; |
288 |
} |
} |
289 |
|
|
290 |
|
display::SpriteId get_spriteid() const { return sprite_id; } |
291 |
|
|
292 |
protected: |
protected: |
293 |
Actor(const char *name, const px::V3 &pos); |
Actor(const char *name, const px::V3 &pos); |
294 |
|
|
295 |
void set_model(const char *mname, const px::V3 &pos); |
void set_model(const string &mname, const px::V3 &pos); |
296 |
void set_model(const char *mname); |
void set_model(const string &mname); |
297 |
void set_attrib(const string &key, const Value &val); |
void set_attrib(const string &key, const Value &val); |
298 |
|
|
|
display::SpriteId get_spriteid() const { return sprite_id; } |
|
|
|
|
299 |
private: |
private: |
300 |
virtual void on_motion(px::V3 newpos) {} |
virtual void on_motion(px::V3 newpos) {} |
301 |
world::ActorInfo actorinfo; |
world::ActorInfo actorinfo; |