DI-Guy SDK Documentation  13.2
diguyCharacterTypeMap.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2016 VT MAK
4  ** All rights reserved.
5  *********************************************************************/
6 
7 
8 
9 #ifndef __diguyCharacterTypeMap_H
10 #define __diguyCharacterTypeMap_H
11 
12 
13 #ifdef SWIG
15 #else
16 #define CPLUSPLUS_ONLY
17 #endif
18 
19 #ifdef CPLUSPLUS_ONLY
20 class bdiMotgenTypeMap;
21 
22 #include <diguy_constants.h>
23 #endif
24 
25 
26 #include <declspec_diguy.h>
27 
28 
29 /****************************************************************************/
30 /*l
31  *b Description:
32  **
33  ** This enumeration allows type map fields to be queried using a
34  ** numerical value rather than a string name of the field.
35  **
36  ** See the top-level description of the diguyCharacterTypeMap for
37  ** information about what each field means.
38  */
39 typedef enum {
40 
41  /*l
42  ** As string: "unknown"
43  */
45 
46  /*l
47  ** As string: "character_class"
48  */
50 
51  /*l
52  ** As string: "category"
53  */
55 
56  /*l
57  ** As string: "subcategory"
58  */
60 
61  /*l
62  ** As string: "sex"
63  */
65 
66  /*l
67  ** As string: "age"
68  */
70 
71  /*l
72  ** As string: "race"
73  */
75 
76  /*l
77  ** As string: "country"
78  */
80 
81  /*l
82  ** As string: "military_branch"
83  */
85 
86  /*l
87  ** As string: "carried_object"
88  */
90 
91  /*l
92  ** How many fields there are.
93  */
95 
97 
98 
99 BDI_DECLSPEC_diguy
101 
102 BDI_DECLSPEC_diguy
104 
105 
106 /*********************************************************************/
303 class BDI_DECLSPEC_diguy diguyCharacterTypeMap
304 {
305 
306 public:
307 
308  /*l
309  *b Description:
310  **
311  ** This function returns the type map id of this type map object,
312  ** in which the current value of all fields are concatenated
313  ** together, separated by slashes.
314  **
315  ** An example return value is
316  ** "human/military/soldier/male/adult/black/usa/army/m16".
317  **
318  *b Returns:
319  **
320  ** type map id string; will never be NULL
321  */
322  const char* get_type_map_id();
323 
324  /*l
325  *b Description:
326  **
327  ** This function returns the character type this type map maps to.
328  ** This is important for match results.
329  **
330  ** The returned character type can be used, for example, in a call
331  ** to diguyScenario::create_character().
332  **
333  *b Returns:
334  **
335  ** character type string; will never be NULL
336  */
337  const char* get_mapped_character_type();
338 
339  /*l
340  *b Description:
341  **
342  ** This function returns the appearance this type map maps to.
343  ** This is important for match results.
344  **
345  ** The returned appearance can be used, for example, in a call
346  ** to diguyCharacter::set_appearance().
347  **
348  *b Returns:
349  **
350  ** appearance string; will never be NULL
351  */
352  const char* get_mapped_appearance();
353 
354  /*l
355  *b Returns:
356  **
357  ** the value of the specified field
358  */
359  const char* get_field_value(diguyCharacterTypeMapField field);
360 
361  /*l
362  *b Returns:
363  **
364  ** the value of the specified field
365  */
366  const char* get_field_value_using_field_string(const char* field);
367 
368 
369 /*********************************************************************
370  **
371  *2 Type Map Query Result Functions
372  **
373  ** Some functions query DI-Guy for the closest match of
374  ** character type and appearance to specified type map field
375  ** selections. The result of such a query is returned in
376  ** a diguyCharacterTypeMap object.
377  **
378  ** These functions return information from the returned object
379  ** about whether there was actually a match, how many exact
380  ** field matches there were, etc.
381  */
382 
383  /*l
384  *b Returns:
385  **
386  ** whether the most recent match call passed or not; 1 if so,
387  ** 0 if not
388  */
389  int get_most_recent_match_passed();
390 
391  /*l
392  *b Returns:
393  **
394  ** total match value from most recent match operation; higher number
395  ** means better match
396  */
397  int get_most_recent_match_level();
398 
399  /*l
400  *b Returns:
401  **
402  ** number of exact value matches in most recent match operation
403  */
404  int get_most_recent_exact_value_matches();
405 
406  /*l
407  *b Returns:
408  **
409  ** number of alternate value matches in most recent match operation
410  */
411  int get_most_recent_alternate_value_matches();
412 
413  /*l
414  *b Returns:
415  **
416  ** number of wildcard value matches in most recent match operation
417  */
418  int get_most_recent_wildcard_value_matches();
419 
420  /*l
421  *b Returns:
422  **
423  ** number of fields that have wildcard values
424  */
425  int get_num_wildcards();
432 #ifdef CPLUSPLUS_ONLY
433 
434  bdiMotgenTypeMap* get_scripted_object() {return m_scripted_object;}
435 
436 private:
437 
438  /*l
439  ** A private constructor.
440  */
441  diguyCharacterTypeMap(bdiMotgenTypeMap* scripted_object);
442 
443  /*l
444  ** A private destructor.
445  */
447 
448  /*l
449  ** A pointer to internal data.
450  */
451  bdiMotgenTypeMap* m_scripted_object;
452  friend class bdiMotgenTypeMap;
453 
454 #endif
455 
456 };
457 
458 
459 #endif /* __diguyCharacterTypeMap_H */
460 
461 
As string: "subcategory".
Definition: diguyCharacterTypeMap.h:53
diguyCharacterTypeMapField
This enumeration allows type map fields to be queried using a numerical value rather than a string na...
Definition: diguyCharacterTypeMap.h:33
As string: "country".
Definition: diguyCharacterTypeMap.h:73
As string: "race".
Definition: diguyCharacterTypeMap.h:68
As string: "unknown".
Definition: diguyCharacterTypeMap.h:38
How many fields there are.
Definition: diguyCharacterTypeMap.h:88
As string: "category".
Definition: diguyCharacterTypeMap.h:48
As string: "carried_object".
Definition: diguyCharacterTypeMap.h:83
The character type map provides extra information about DI-Guy character types and appearances...
Definition: diguyCharacterTypeMap.h:290
As string: "age".
Definition: diguyCharacterTypeMap.h:63
As string: "sex".
Definition: diguyCharacterTypeMap.h:58
const char * diguy_character_type_map_field_to_string(diguyCharacterTypeMapField field)
As string: "military_branch".
Definition: diguyCharacterTypeMap.h:78
As string: "character_class".
Definition: diguyCharacterTypeMap.h:43
diguyCharacterTypeMapField diguy_character_type_map_field_from_string(const char *string)