/inherit/base.c(1) /inherit/base.c(1) DDEESSCCRRIIPPTTIIOONN //iinnhheerriitt//bbaassee..cc is the base object for all objects. All objects mmuusstt inherit base object to gain the basic func­ tionalities required for all objects (names, descriptions ...), so functions and variables described here are included in eevveerryy object. VVAARRIIAABBLLEESS (all variables are accessible with set() and query() func­ tions, see below) _s_t_r_i_n_g _n_a_m_e `name' is the primary name an object is called. It's often used as abbreviation when whole short description is not needed. _s_t_r_i_n_g _*_a_l_i_a_s_e_s Aliases are the secondary name(s) of an object. Their purpose is to ease handling of objects by giving several names for user to choose from. _s_t_r_i_n_g _s_h_o_r_t___d_e_s_c Short description is the description that the user sees when (s)he has the object in his view, but when not having chance to examine it more thor­ oughly (inventory lists, ...). _s_t_r_i_n_g _l_o_n_g___d_e_s_c Long description is sent to user when looking or examining the specific object. This usually requires the object to be in his/her inventory or environment. FFUUNNCCTTIIOONNSS _m_i_x_e_d _s_e_t_(_s_t_r_i_n_g _v_a_r_, _s_t_r_i_n_g _v_a_l_u_e_) set() is used to give values to variables included in object. The name of the variable (`var') and it's value (`value') are given as arguments. Example: THIS->set("name", "Dazzt"); _m_i_x_e_d _q_u_e_r_y_(_s_t_r_i_n_g _v_a_r_) query() is used to get values from variables. The name of the variable (`var') is given as argument. MAJIK INHERITABLES 1 /inherit/base.c(1) /inherit/base.c(1) Example: string name = THIS->query("name"); _s_t_r_i_n_g _s_h_o_r_t_(_) short() returns the short description of an object. The main use for this is to create custom routines that return different short descriptions depending on object's state (for example open or closed). _s_t_r_i_n_g _l_o_n_g_(_) long() returns the long description of an object. It's included for same reasons as short() (see above). _s_t_r_i_n_g _s_t_a_t___m_e_(_) stat_me() is the function for giving statistics about object. It's intended for wizards and should be never shown to mortals as it may contain very specific information about object. _v_o_i_d _r_e_m_o_v_e_(_) remove() destructs the object and gives a message about it to object's environment. _v_o_i_d _m_o_v_e_(_m_i_x_e_d _t_a_r_g_e_t_) move() is used to move object inside another object (`target'). _i_n_t _i_d_(_s_t_r_i_n_g _n_a_m_e_) id() is the function used by gamedriver to identify objects. It returns either 1 or 0 depending on if object recognizes itself by name (`name'). One shouldn't need this function in his/her code, as it is one of the vital functions of an object, and shouldn't be replaced unless you _really_ know what you are doing. MAJIK INHERITABLES 2