Home

[Package Index | Mudlib Index | Effect Index]

File /secure/simul_efun/obj_parser.c

This is the object matching code. It is based on some code by Scatter at Dawn Whispers, although this is both cut down and extended from what scatter had written.

Inherits

This class inherits the following classes /secure/simul_efun/multiple_short.c

Includes

This class includes the following files /include/playtesters.h and /include/obj_parser.h

Method index

Public Functions

These are functions that everyone can access.

.

    match_object_in_array
    class obj_match match_object_in_array(string input,
                                          object * ob_list,
                                          int type,
                                          object player)
    

    Find an object in the given array that matches the given words. This will only return a correct match if the entire string matches. If it gets a partial match then nothing will be returned. The return array is of the format:
    ({ flag, class obj_match info })
    
    The flag can be one of:
    OBJ_PARSER_SUCCESS
    Successfuly matched the objects. the objects part of the class will contain the matched objects.
    OBJ_PARSER_NO_MATCH
    No successful match. The text bit of the omatch class will contain the text that didn't match
    OBJ_PARSER_AMBIGUOUS
    An ambigous match is returned, this means 'frog' was referenced when there was more than one frog. The objects part of the class has all the objects there were matched
    OBJ_PARSER_BAD_FRACTION
    The specified fracition was bad, the text bit of the class contains the bad fraction.
    OBJ_PARSER_FRACTION
    Means that a fraction was attempted to be applied to multiple objects.
    OBJ_PARSER_TOO_DARK
    Unable to match the specified object because it is too dark.

  • Parameters:
    input - the input string to match
    ob_list - the object to list to match in
    type - we restrict the matching to certain groups of objects
    player - the person doing the lookup
  • Returns:
    an array of the format ({ flag, class obj_match info })
      match_objects_failed_mess
      string match_objects_failed_mess(class obj_match failed_match)
      

      This method returns the failed message for the specified failed match string.
      • Parameters:
        failed_match - the return result from match_objects_*
      • Returns:
        the message to print when it gets an error
          match_objects_for_existence
          object * match_objects_for_existence(string input,
                                               object * env_list,
                                               object player)
          

          This method checks for existance of the specified objects. It will return any ambiguous matches as well as real matches. This should only be used in cases in the code where it is not nessessary to distinguish between different objects of the same type.
          • Parameters:
            input - the input string to check
            env_list - the environments to check in
            player - the player to check with
          • Returns:
            the array of objects
              match_objects_in_environments
              class obj_match match_objects_in_environments(string input,
                                                            mixed env_list,
                                                            int type,
                                                            object player)
              

              Find an object in the given environments that match the given words. This will only return a correct match if the entire string matches. If it gets a partial match then nothing will be returned. The return array is of the format:
              ({ flag, class obj_match info })
              
              The flag can be one of:
              OBJ_PARSER_SUCCESS
              Successfuly matched the objects. the objects part of the class will contain the matched objects.
              OBJ_PARSER_NO_MATCH
              No successful match. The text bit of the omatch class will contain the text that didn't match
              OBJ_PARSER_AMBIGUOUS
              An ambigous match is returned, this means 'frog' was referenced when there was more than one frog. The objects part of the class has all the objects there were matched
              OBJ_PARSER_BAD_FRACTION
              The specified fracition was bad, the text bit of the class contains the bad fraction.
              OBJ_PARSER_FRACTION
              Means that a fraction was attempted to be applied to multiple objects.
              OBJ_PARSER_TOO_DARK
              Unable to match the specified object because it is too dark.
              • Parameters:
                input - the input string to match
                env_list - the environments to get the objects from
                singular - force a singular match
                player - the person doing the lookup
              • Returns:
                an array of the format ({ flag, class obj_match info })
Valid HTML 4.01 Transitional
Valid CSS!
Read More