aboutsummaryrefslogtreecommitdiff
path: root/src/parsec_server/include/con_info_sv.h
blob: dec756d99e4e00de2390da13d1153132faa26f9b (plain)
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
/*
 * PARSEC HEADER: con_info_sv.h
 */

#ifndef _CON_INFO_SV_H_
#define _CON_INFO_SV_H_


// callback function type
typedef int (*notify_callback_fpt)( GenObject *base );


// access information for single object property (type/class field)

struct proplist_s {

	const char*			propname;		// name property can be accessed by
	size_t				propoffset;		// offset of property in obj structure
	int 				bmin;			// minimum value of property
	int 				bmax;			// maximum value of property
	int					fieldtype;		// field's data type
	notify_callback_fpt notify_callback; // callback on field value changes
};

//NOTE:
// bmin and bmax (value bounds) for all types other than
// PROPTYPE_INT have to be specified in fixed-point!

//NOTE:
// for PROPTYPE_STRING and PROPTYPE_CHARPTR bmin and bmax specify
// minimum and maximum number of chars (excluding the '\0').

#define PROPTYPE_INT		0
#define PROPTYPE_FLOAT		1
#define PROPTYPE_GEOMV		2
#define PROPTYPE_FIXED		3
#define PROPTYPE_STRING		4
#define PROPTYPE_CHARPTR	5


// external functions

void	CON_RegisterCustomType( dword objtypeid, proplist_s *proplist );

char*	BuildTypeInfo( int typeindex );
char*	BuildClassInfo( int classindex );

int		CheckSetObjTypeProperty( const char *query, const char *scan );
int 	CheckSetObjClassProperty( const char *query, const char *scan );
int		CheckSetObjInstanceProperty( const char *query, const char *scan );

int 	CheckTypeInfo( const char *scan );
int 	CheckClassInfo( const char *scan );
int		CheckInstanceInfo( const char *scan );

int		WritePropList( FILE* fp, dword objid );

int		Cmd_FaceInfo( const char *command );


#endif // _CON_INFO_SV_H_