a library to speed up the development of Fivem scripts and frameworks
fivem-ts - Documentation v0.7.5 • Docs
fivem-ts - Documentation v0.7.5 / Server / BucketCollection
Represents a collection of population-aware routing buckets.
In the context of a FiveM server, routing buckets are used to segregate entities and players into different logical spaces that can operate independently. These buckets allow you to control entity routing, player visibility, and interaction within the game world, with the added capability of managing population awareness.
new BucketCollection():
BucketCollection
Creates a new instance of the BucketCollection
class.
server/models/BucketCollection.ts:17
get
BucketCount():number
Gets the count of buckets in the collection.
number
The number of buckets in the collection.
server/models/BucketCollection.ts:33
get
Buckets():Map
<number
,Bucket
>
Gets the map of buckets.
Map
<number
, Bucket
>
A map where the key is the bucket ID and the value is the bucket.
server/models/BucketCollection.ts:24
addBucket(
bucket
):void
Adds a new bucket to the collection.
• bucket: Bucket
The bucket to add to the collection.
void
server/models/BucketCollection.ts:78
clear():
void
Removes all buckets from the collection.
void
server/models/BucketCollection.ts:98
createBucket(
name
,id
,population
?,entityLockdownMode
?):void
Create a new bucket and add it to the collection.
• name: string
The name of the bucket.
• id: number
The unique identifier for the bucket.
• population?: boolean
(Optional) A flag to enable or disable population within the bucket. Defaults to false
.
• entityLockdownMode?: BucketLockdownMode
(Optional) The mode controlling entity access within the bucket. Defaults to BucketLockdownMode.Relaxed
.
void
server/models/BucketCollection.ts:64
getAllBuckets():
Bucket
[]
Retrieves all buckets in the collection.
Bucket
[]
An array of all buckets in the collection.
server/models/BucketCollection.ts:42
getBucket(
bucketId
):Bucket
Retrieves a bucket from the collection.
• bucketId: number
The unique identifier of the bucket to retrieve.
The bucket with the specified identifier, or undefined
if no such bucket exists.
server/models/BucketCollection.ts:52
getEmptyBuckets():
Bucket
[]
Retrieves a list of buckets that are currently empty.
Bucket
[]
An array of buckets that are currently empty.
server/models/BucketCollection.ts:116
getPopulatedBuckets():
Bucket
[]
Retrieves a list of buckets that are currently populated.
Bucket
[]
An array of buckets that are currently populated.
server/models/BucketCollection.ts:107
removeBucket(
bucketId
):void
Removes a bucket from the collection.
• bucketId: number
The unique identifier of the bucket to remove.
void