OpenSim.Region.ScriptEngine.Shared.Api.LSL_Api.llGetParcelPrimCount C# (CSharp) Method

llGetParcelPrimCount() public method

public llGetParcelPrimCount ( OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3 pos, int category, int sim_wide ) : OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger
pos OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3
category int
sim_wide int
return OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger
        public LSL_Integer llGetParcelPrimCount(LSL_Vector pos, int category, int sim_wide)
        {
            m_host.AddScriptLPS(1);

            ILandObject lo = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y);

            if (lo == null)
                return 0;

            IPrimCounts pc = lo.PrimCounts;

            if (sim_wide != ScriptBaseClass.FALSE)
            {
                if (category == ScriptBaseClass.PARCEL_COUNT_TOTAL)
                {
                    return pc.Simulator;
                }
                else
                {
                    // counts not implemented yet
                    return 0;
                }
            }
            else
            {
                if (category == ScriptBaseClass.PARCEL_COUNT_TOTAL)
                    return pc.Total;
                else if (category == ScriptBaseClass.PARCEL_COUNT_OWNER)
                    return pc.Owner;
                else if (category == ScriptBaseClass.PARCEL_COUNT_GROUP)
                    return pc.Group;
                else if (category == ScriptBaseClass.PARCEL_COUNT_OTHER)
                    return pc.Others;
                else if (category == ScriptBaseClass.PARCEL_COUNT_SELECTED)
                    return pc.Selected;
                else if (category == ScriptBaseClass.PARCEL_COUNT_TEMP)
                    return 0; // counts not implemented yet
            }

            return 0;
        }
LSL_Api