DI-Guy SDK Documentation  13.7
diguyCharacterTypeMap.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2023 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 #pragma once
7 
8 #ifdef SWIG
10 #else
11 #define CPLUSPLUS_ONLY
12 #endif
13 
14 #ifdef CPLUSPLUS_ONLY
15 class bdiMotgenTypeMap;
17 #include <diguy_constants.h>
18 #endif
19 
20 #include <declspec_diguy.h>
21 
22 
23 BDI_DECLSPEC_diguy
25 
26 BDI_DECLSPEC_diguy
28 
29 
30 /*********************************************************************/
228 class BDI_DECLSPEC_diguy diguyCharacterTypeMap
229 {
230 public:
231 
232  /*l
233  *b Description:
234  **
235  ** This function returns the type map id of this type map object,
236  ** in which the current value of all fields are concatenated
237  ** together, separated by slashes.
238  **
239  ** An example return value is
240  ** "human/military/soldier/male/adult/black/usa/army/m16".
241  **
242  *b Returns:
243  **
244  ** type map id string; will never be NULL
245  */
246  const char* get_type_map_id();
247 
248  /*l
249  *b Description:
250  **
251  ** This function returns the character type this type map maps to.
252  ** This is important for match results.
253  **
254  ** The returned character type can be used, for example, in a call
255  ** to diguyScenario::create_character().
256  **
257  *b Returns:
258  **
259  ** character type string; will never be NULL
260  */
261  const char* get_mapped_character_type();
262 
263  /*l
264  *b Description:
265  **
266  ** This function returns the appearance this type map maps to.
267  ** This is important for match results.
268  **
269  ** The returned appearance can be used, for example, in a call
270  ** to diguyCharacter::set_appearance().
271  **
272  *b Returns:
273  **
274  ** appearance string; will never be NULL
275  */
276  const char* get_mapped_appearance();
277 
278  /*l
279  *b Returns:
280  **
281  ** the value of the specified field
282  */
283  const char* get_field_value( diguyCharacterTypeMapField field );
284 
285  /*l
286  *b Returns:
287  **
288  ** the value of the specified field
289  */
290  const diguyCharacterTypeMapFieldValues& get_field_values();
291 
292  /*l
293  *b Returns:
294  **
295  ** the value of the specified field
296  */
297  const char* get_field_value_using_field_string( const char* field );
298 
299 
300 /*********************************************************************
301  **
302  *2 Type Map Query Result Functions
303  **
304  ** Some functions query DI-Guy for the closest match of
305  ** character type and appearance to specified type map field
306  ** selections. The result of such a query is returned in
307  ** a diguyCharacterTypeMap object.
308  **
309  ** These functions return information from the returned object
310  ** about whether there was actually a match, how many exact
311  ** field matches there were, etc.
312  */
313 
314  /*l
315  *b Description:
316  **
317  ** Performs a match check against the given field values (and alternates, if given).
318  **
319  ** This will update the most recent values returned by the following accessors.
320  **
321  *b Returns:
322  **
323  ** The total match value for the match operation. Higher number
324  ** means better match. If match level is 0, match failed.
325  */
326  int match_level( const diguyCharacterTypeMapFieldValues& field_values,
327  const diguyCharacterTypeMapFieldValues* alternate_values = nullptr );
328 
329  /*l
330  *b Returns:
331  **
332  ** whether the most recent match call passed or not; 1 if so,
333  ** 0 if not
334  */
335  int get_most_recent_match_passed();
336 
337  /*l
338  *b Returns:
339  **
340  ** total match value from most recent match operation; Higher number
341  ** means better match. If match level is 0, match failed.
342  */
343  int get_most_recent_match_level();
344 
345  /*l
346  *b Returns:
347  **
348  ** number of exact value matches in most recent match operation
349  */
350  int get_most_recent_exact_value_matches();
351 
352  /*l
353  *b Returns:
354  **
355  ** number of alternate value matches in most recent match operation
356  */
357  int get_most_recent_alternate_value_matches();
358 
359  /*l
360  *b Returns:
361  **
362  ** number of wildcard value matches in most recent match operation
363  */
364  int get_most_recent_wildcard_value_matches();
365 
366  /*l
367  *b Returns:
368  **
369  ** number of fields that have wildcard values
370  */
371  int get_num_wildcards();
372 
373 
378 #ifdef CPLUSPLUS_ONLY
379 
380  bdiMotgenTypeMap* get_scripted_object() {return m_scripted_object;}
381 
382 private:
383 
384  /*l
385  ** A private constructor.
386  */
387  diguyCharacterTypeMap( bdiMotgenTypeMap* scripted_object );
388 
389  /*l
390  ** A private destructor.
391  */
393 
394  /*l
395  ** A pointer to internal data.
396  */
397  bdiMotgenTypeMap* m_scripted_object;
398  friend class bdiMotgenTypeMap;
399 
400 #endif
401 
402 };
diguyCharacterTypeMapField
This enumeration allows type map fields to be queried using a numerical value rather than a string na...
Definition: diguy_constants.h:123
This class holds the type map field values for a specific type mapping.
Definition: diguyCharacterTypeMapFieldValues.h:35
The character type map provides extra information about DI-Guy character types and appearances...
Definition: diguyCharacterTypeMap.h:221
const char * diguy_character_type_map_field_to_string(diguyCharacterTypeMapField field)
diguyCharacterTypeMapField diguy_character_type_map_field_from_string(const char *string)