1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
#include "trigger.h"
/* Trigger:
* Constructor. Sets things and whatnot. Not very exciting.
*/
trigger::trigger( char * info, int size_data, int type, int xv, int yv ) {
data = info;
size_d = size_data;
id = type;
loc_x = xv;
loc_y = yv;
}
/* kind:
* Returns a number that determines what kind of trigger this is.
* Those numbers are defined elsewhere.
*/
int trigger::kind() {
return id;
}
/* kill:
* Forces trigger to die.
*/
void trigger::kill() {
id = -1;
}
/* size:
* Returns the size of the data the trigger is storing
*/
int trigger::size() {
return size_d;
}
/* CX:
* Returns the X coordinate of the trigger
*/
int trigger::CX() {
return loc_x;
}
/* CY:
* Returns the Y coordinate of the trigger
*/
int trigger::CY() {
return loc_y;
}
/* get:
* Returns the data stored by the trigger.
*/
void * trigger::get( void * helper ) {
return data;
}
/* ~Trigger:
* Deletes data
*/
trigger::~trigger() {
if ( data )
delete[] data;
}
|