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