Category: Objects
/ Search Since engine version: 4.6.5.0 CP
Description
Searched objects by certain criteria and returns the number of objects found. If iWdt and iHgt are both -1, the closest object is found. If iWdt and iHgt are both 0, only the point iX/iY will be checked. If iX, iY, iWdt and iHgt are all 0, the whole map will be searched (even in local calls). All other criteria have to be fulfilled if they are not 0.
Syntax
int ObjectCount
(id idDef, int iX, int iY, int iWdt, int iHgt, int dwOCF, string szAction, object pActionTarget, any pContainer, int iOwner);
Parameters
idDef:
[opt]
Object type
iX:
[opt]
Left boundary coordinate of the target rectangle (x coordinate).
iY:
[opt]
Top boundary coordinate of the target rectangle (y coordinate).
iWdt:
[opt]
Width of search rectangle
iHgt:
[opt]
Height of search rectangle
dwOCF:
[opt]
Object attributes. Only objects with all specfied attributes will be returned in the search. 0 finds all objects.
[opt]
Container object. If specified, only this container will be searched. Also possible: NoContainer (object is not contained) or AnyContainer (object is contained in any container).