intficpy/parser.py
def checkRange(self, things, scope):
        """
        Eliminates all grammatical object candidates that are not within the scope of the
        current verb
        Takes arguments self.game.me, things, a list of Thing objects (thing.py) that are candidates
        for the target of a player's action, and scope, a string representing the range of
        the verb
        Returns a list of Thing objects, or an empty list
        """
        out_range = []
        if scope == "wearing":
            for thing in things:
                if not self.wearRangeCheck(thing):
                    out_range.append(thing)
        elif scope == "room":
            for thing in things:
                if not self.roomRangeCheck(thing) and self.invRangeCheck(thing):
                    # implicit drop
                    DropVerb().verbFunc(self.game, thing)
                    pass
                elif not self.roomRangeCheck(thing):
                    out_range.append(thing)
        elif scope == "knows":
            things = self.getUniqueConcepts(things)
            for thing in things:
                if not self.knowsRangeCheck(thing):
                    out_range.append(thing)
        elif scope == "near" or scope == "roomflex":
            for thing in things:
                if not self.nearRangeCheck(thing):
                    out_range.append(thing)
        elif scope == "inv" or scope == "invflex":
            for thing in things:
                if self.roomRangeCheck(thing):
                    pass
                elif not self.invRangeCheck(thing):
                    out_range.append(thing)
        else:
            raise VerbDefinitionError(f"Unrecognized object scope {scope}")
        # remove items that require implicit actions in the event of ambiguity
        for thing in out_range:
            things.remove(thing)
        things2 = list(things)
        out_range = []
        if len(things) > 1:
            for thing in things:
                if scope in ["room", "roomflex"] and not self.roomRangeCheck(thing):
                    out_range.append(thing)
                elif scope in ["inv", "invflex"] and not self.invRangeCheck(thing):
                    out_range.append(thing)
                elif thing.ignore_if_ambiguous:
                    out_range.append(thing)
            for thing in out_range:
                things2.remove(thing)
            if len(things2) > 0:
                return things2
        return things

        Eliminates all grammatical object candidates that are not within the scope of the
        current verb
        Takes arguments self.game.me, things, a list of Thing objects (thing.py) that are candidates
        for the target of a player's action, and scope, a string representing the range of
        the verb
        Returns a list of Thing objects, or an empty list
        
Eliminates all grammatical object candidates that are not within the scope of the
current verb
Takes arguments self.game.me, things, a list of Thing objects (thing.py) that are candidates
for the target of a player's action, and scope, a string representing the range of
the verb
Returns a list of Thing objects, or an empty list
Eliminates all grammatical object candidates that are not within the scope of the current verb Takes arguments self . game . me things a list of Thing objects ( thing . py ) that are candidates for the target of a player ' s action and scope a string representing the range of the verb Returns a list of Thing objects or an empty list
def checkRange(self, things, scope):
        out_range = []
        if scope == "wearing":
            for thing in things:
                if not self.wearRangeCheck(thing):
                    out_range.append(thing)
        elif scope == "room":
            for thing in things:
                if not self.roomRangeCheck(thing) and self.invRangeCheck(thing):
                    DropVerb().verbFunc(self.game, thing)
                    pass
                elif not self.roomRangeCheck(thing):
                    out_range.append(thing)
        elif scope == "knows":
            things = self.getUniqueConcepts(things)
            for thing in things:
                if not self.knowsRangeCheck(thing):
                    out_range.append(thing)
        elif scope == "near" or scope == "roomflex":
            for thing in things:
                if not self.nearRangeCheck(thing):
                    out_range.append(thing)
        elif scope == "inv" or scope == "invflex":
            for thing in things:
                if self.roomRangeCheck(thing):
                    pass
                elif not self.invRangeCheck(thing):
                    out_range.append(thing)
        else:
            raise VerbDefinitionError(f"Unrecognized object scope {scope}")
        for thing in out_range:
            things.remove(thing)
        things2 = list(things)
        out_range = []
        if len(things) > 1:
            for thing in things:
                if scope in ["room", "roomflex"] and not self.roomRangeCheck(thing):
                    out_range.append(thing)
                elif scope in ["inv", "invflex"] and not self.invRangeCheck(thing):
                    out_range.append(thing)
                elif thing.ignore_if_ambiguous:
                    out_range.append(thing)
            for thing in out_range:
                things2.remove(thing)
            if len(things2) > 0:
                return things2
        return things
def checkRange ( self , things , scope ) : out_range = [ ] if scope == "wearing" : for thing in things : if not self . wearRangeCheck ( thing ) : out_range . append ( thing ) elif scope == "room" : for thing in things : if not self . roomRangeCheck ( thing ) and self . invRangeCheck ( thing ) : DropVerb ( ) . verbFunc ( self . game , thing ) pass elif not self . roomRangeCheck ( thing ) : out_range . append ( thing ) elif scope == "knows" : things = self . getUniqueConcepts ( things ) for thing in things : if not self . knowsRangeCheck ( thing ) : out_range . append ( thing ) elif scope == "near" or scope == "roomflex" : for thing in things : if not self . nearRangeCheck ( thing ) : out_range . append ( thing ) elif scope == "inv" or scope == "invflex" : for thing in things : if self . roomRangeCheck ( thing ) : pass elif not self . invRangeCheck ( thing ) : out_range . append ( thing ) else : raise VerbDefinitionError ( f"Unrecognized object scope {scope}" ) for thing in out_range : things . remove ( thing ) things2 = list ( things ) out_range = [ ] if len ( things ) > 1 : for thing in things : if scope in [ "room" , "roomflex" ] and not self . roomRangeCheck ( thing ) : out_range . append ( thing ) elif scope in [ "inv" , "invflex" ] and not self . invRangeCheck ( thing ) : out_range . append ( thing ) elif thing . ignore_if_ambiguous : out_range . append ( thing ) for thing in out_range : things2 . remove ( thing ) if len ( things2 ) > 0 : return things2 return things
Eliminates all grammatical object candidates that are not within the scope of the
current verb
Takes arguments self.game.me, things, a list of Thing objects (thing.py) that are candidates
for the target of a player's action, and scope, a string representing the range of
the verb
Returns a list of Thing objects, or an empty list
Eliminates all grammatical object candidates that are not within the scope of the current verb Takes arguments self . game . me things a list of Thing objects ( thing . py ) that are candidates for the target of a player ' s action and scope a string representing the range of the verb Returns a list of Thing objects or an empty list
"""
        Eliminates all grammatical object candidates that are not within the scope of the
        current verb
        Takes arguments self.game.me, things, a list of Thing objects (thing.py) that are candidates
        for the target of a player's action, and scope, a string representing the range of
        the verb
        Returns a list of Thing objects, or an empty list
        """ # implicit drop # remove items that require implicit actions in the event of ambiguity
self
things
scope