Gamequark is Gamegine's basic game object class. In addition to the characteristics of its parent class, it has support for the concept of "life"/"death" and sides/factions.
class gamequark : public quark {
protected:
void calc_initmx(vector4f *in, vector4f *out);
A replacement for the virtual function defined in "quark".
virtual void sum_hp(quark *target, quark *parent);
This method is used to calculate the field "total_hp". "parent" is the parent of this object in the hiearchy tree. "target" is the object to add its hp total to the current object.
virtual void deathcheck(quark *parent);
This method is used to determine if this object should be disabled from the animation/rendering pipe. "parent" is the parent object of this object in the game hiearchy tree.
public:
int query_category();
A replacement for the virtual function defined in "superclass".
int query_whatami();
A replacement for the virtual function defined in "superclass".
int query_whatwasi(int type);
A replacement for the virtual function defined in "superclass".
void preprocess(void *data);
A replacement for the virtual function defined in "superclass".
int parse(FILE *infile, char *token);
A replacement for the virtual function defined in "superclass".
void render_object(engine *proc, quark *parent, vector4f *frustum, unsigned int frustum);
A replacement for the virtual function defined in "quark".
void update(dbl_llist_manager *hiearchical_manager, quark *parent);
A replacement for the virtual function defined in "quark".
int query_specific_data(unsigned int type, void *data);
A replacement for the virtual function defined in "quark".
int init_hp, hp, total_hp;
These fields are used to determine the active/inactive state of a game object. "init_hp" is the object's initial health. "hp" is the object's current health. "total_hp" is the object's subtree health total. It is assumed that if "hp" is <= 0, then the object should be made inactive, unless it has child nodes, then "total_hp" is used.
atom_list_type *atomparent;
This field is a pointer to the head hiearchical node for the tree containing this object.
vector4f perceived_vel;
This field contains the apparent velocity of this object. The first 3 elements contain the velocity over the last time slice, and the 4th element is the length of the time slice.
gamequark();
virtual ~gamequark();
virtual int apply_damage(unsigned int properties, int *damage);
This method applies "damage" to the current game object. "properties" is a mask that is used to determine the "type" of damage. "damage" is to be reduced by the amount that this object absorbs. In most cases, if the damage is more than the object can take, it is spread out to it's siblings. The returned value is the amount of damage actually applied to the object.
};
Gameatom is Gamegine's basic hiearchical head object class. In addition to the characteristics of its parent class, it has support for the concept of "life"/"death" and sides/factions (similar to gamequark).
class gameatom : public atom {
protected:
void calc_initmx(vector4f *in, vector4f *out);
A replacement for the virtual function defined in "quark".
virtual void sum_hp(quark *target, quark *parent);
This method is used to calculate the field "total_hp". "parent" is the parent of this object in the hiearchy tree. "target" is the object to add its hp total to the current object.
public:
int query_whatami();
A replacement for the virtual function defined in "superclass".
int query_whatwasi(int type);
A replacement for the virtual function defined in "superclass".
int parse(FILE *infile, char *token);
A replacement for the virtual function defined in "superclass".
void update(dbl_llist_manager *hiearchical_manager, quark *parent);
A replacement for the virtual function defined in "quark".
int query_specific_data(unsigned int type, void *data);
A replacement for the virtual function defined in "quark".
void new_action(FILE *infile, float timefactor, char *buffer);
A replacement for the virtual function defined in "quark".
basic_event *read_event(FILE *infile, char *token, int frame_offset);
A replacement for the virtual function defined in "atom".
void new_action(int frameno, dbl_llist_manager *hiearchy_manager);
A replacement for the virtual function defined in "atom".
string_type filename;
This field is used to hold the object's .atm filename, as an alternative to quark::name. This free's up "name" to be individualized to allow the same .atm to be reused w/ unique identifiers.
int total_hp;
This field is used to determine if this tree is to be considered inactive - if <= 0.
vector3f perceived_vel;
string_type full_name;
This field contains the "formal" name for the object - usually used for display purposes.
virtual ~gameatom();
virtual int apply_damage(gamequark *child, unsigned int properties, int *damage);
This method applies "damage" to the current game tree. "properties" is a mask that is used to determine the "type" of damage. "damage" is to be reduced by the amount that this object absorbs. "child" is the node in the tree that is to receive the damage. The returned value is the amount of damage actually applied to the object.
};
This class is a loader used to identify, instantiate, and parse gamequark game objects.
class gamequark_loader : public quark_loader {
protected:
superclass *make_object();
A replacement for the virtual function defined in "loader". This method returns an instance of gamequark.
public:
virtual ~gamequark_loader();
gamequark_loader();
};
This class is a loader used to identify, instantiate, and parse gameatom game head nodes.
class gameatom_loader : public quark_loader {
protected:
superclass *make_object();
A replacement for the virtual function defined in "loader". This method returns an instance of gameatom.
public:
virtual ~gameatom_loader();
gameatom_loader();
};
This class is used to keep track of targeted objects.
class target_type {
public:
atom_list_type *object;
This contains a reference to the tree that contains the targeted object.
quark *specific_parent;
This contains the immediate parent to the targeted object.
quark *specific;
This contains the targeted object.
target_type();
};