fantasycalendar / FoundryVTT-Tagger

Other
6 stars 4 forks source link

Feature request - Add a 'hasTags' method to the api #5

Closed p4535992 closed 2 years ago

p4535992 commented 2 years ago

the title is self-explanatory, it would be useful to have a method of checking the presence of tags / tags on the placeable objects you are analyzing. Like this:

Has Tag/Tags

Verify if the PlaceableObject has a given tag or tags

Tagger.hasTags(PlaceableObject,tags, options={}))

@param    {PlaceableObject}  inObject    The PlaceableObject where verify the tags from
@param    {string|array}  tags    The tag/tags to check
@param    {object}  inOptions   An optional object that can contain any of the following:
                                             - matchAny {boolean}        - whether the PlaceableObjects can contain any of the provided tags
                                             - matchExactly {boolean}    - whether the tags on the PlaceableObjects must contain ONLY the tags provided
                                             - caseInsensitive {boolean} - whether the search is case insensitive (capitals vs lowercase is not considered)
                                             - objects {array}           - an array of PlaceableObjects to test
                                             - ignore {array}            - an array of PlaceableObjects to ignore
                                             - sceneId {string}          - a string ID for the scene to search in

@returns  {boolean}              the PlaceableObject has the tags 
p4535992 commented 2 years ago

Looks fine on 1.2.0 ty!!!