Doloro GDK 22 .1.0 Beta
by Tauri Interactive
Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume Class Reference

Detailed Description

Implements the conception of volume-like space bounding the capacity of the storage.

Inheritance diagram for Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume:
Collaboration diagram for Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume:

Classes

class  CrossSessionData
 Container that contains certain entity related data between game sessions. More...
 

Public Member Functions

bool IsVolumeCanFit (Volume space)
 Checks is the certain space can be received from the volume. More...
 
void RecomputeVolumesGrid ()
 Releases current order of volumes and recomputes the grid along with the relevant params.
 
bool PlaceVolume (Volume space, out Guid volumeId)
 Reserves the space into the volume. More...
 
IEnumerator< Guid > GetEnumerator (Item item)
 Enumerator to access entire volumes bonded with the certain storage Item group. More...
 
Item GetBondedResource (Guid volumeId)
 Returns the Item resource binded to the certain volume. More...
 
void MakeBond (Guid volumeId, Item resource)
 Defines bond between grid volume and Item inside connected Storage.source. More...
 
bool ReleaseVolume (Guid volumeId, bool recomute)
 Releases the volume by id and recomputes the space. More...
 
override bool OnTrasactionMask (TransactionService.TransactionOrder order)
 Checking is the demanded volume can be placed in current free space. More...
 
override byte[] SaveSession ()
 Converts current items to volumes table to binary format. More...
 
override void LoadSession (byte[] data)
 Loads volumes to items dependency table. More...
 
IEnumerator< GridSpaceGetEnumerator ()
 Enumerates grid entries. More...
 
void Reserve (TransactionService.TransactionOrder order)
 
void CancelReservation (TransactionService.TransactionOrder order)
 Releases reservation holdings. More...
 
void ConfirmReservation (TransactionService.TransactionOrder order)
 Changes reservation holdings state to permanent. More...
 
object Clone ()
 Clones the volume component on the new game object with disconnection it from the StoragesDatabase. More...
 
virtual void OnStorageRented ()
 The storage entity was rented with a new source StoragesDatabase.StorageContainer. More...
 
virtual void OnStorageRentOver ()
 Occurs when rented storage released from the rent. More...
 
virtual void SetDefault ()
 Sets default property values. More...
 

Protected Member Functions

override void OnModified ()
 Handler that should be called each time when property values have been modified. More...
 
bool PlaceVolume (Volume space, Guid volumeId)
 Reserves the space into the volume. More...
 
void OptimizeFreespaceZones ()
 Removing duplicates or ineffective volumes from free spaces registry.
 
virtual void ExecuteFreeSpaceSplitOrder (VolumeSplitOrder order)
 Applies the split instructions provided with the order to the FreeVolumesRegistry collection. More...
 
virtual void Awake ()
 
virtual void OnDestroy ()
 
void DropGrid ()
 Drops currently precomputed volumes.
 
ICollection< GridSpaceGetSizeSortedVolumes ()
 Returns sorted collection of the located volumes in order from bigger volume to lower. More...
 
ICollection< Guid > GetSizeSortedVolumesIDs ()
 Returns sorted collection of the located volume IDs. in order from bigger volume to lower. More...
 
bool FindCompatibleSpace (Volume volumeToPlace, out GridSpace freeSpace)
 Looking for free space that fits most to required volume. More...
 

Package Attributes

CrossSessionData data = new CrossSessionData()
 Data related to the property.
 

Properties

Volume volume [get, set]
 3 dimensional space provided with the volume. More...
 
List< GridSpaceFreeVolumesRegistry = new List<GridSpace>() [get]
 Collection of volumes available at the moment to receiving new entity. More...
 
string message [get, protected set]
 Message generated to the order during validation precess.
 
Storage storage [get]
 Binded storage source.
 

Events

static Action< Guid > VolumeNotLongerFits
 Occurs in case if the volume that was a part of the space no longer fits the space. More...
 
Action< AEntityFeatureModified
 Occurs when internal systems calling the OnModified handler.
 

Member Function Documentation

◆ CancelReservation()

void Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.CancelReservation ( TransactionService.TransactionOrder  order)

Releases reservation holdings.

Parameters
orderOrder requested reservation previously.

Implements Doloro.InvetorySystem.IReservationAgent.

◆ Clone()

object Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.Clone ( )

Clones the volume component on the new game object with disconnection it from the StoragesDatabase.

Returns
Cloned StorageVolume component.

◆ ConfirmReservation()

void Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.ConfirmReservation ( TransactionService.TransactionOrder  order)

Changes reservation holdings state to permanent.

Parameters
orderOrder requested reservation previously.

Implements Doloro.InvetorySystem.IReservationAgent.

◆ ExecuteFreeSpaceSplitOrder()

virtual void Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.ExecuteFreeSpaceSplitOrder ( VolumeSplitOrder  order)
protectedvirtual

Applies the split instructions provided with the order to the FreeVolumesRegistry collection.

Parameters
orderInstruction that provides computed zones.

◆ FindCompatibleSpace()

bool Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.FindCompatibleSpace ( Volume  volumeToPlace,
out GridSpace  freeSpace 
)
protected

Looking for free space that fits most to required volume.

Parameters
volumeToPlaceVolume to place.
freeSpaceRecommended free space.
Returns
true in case if space found. false otherwise.

◆ GetBondedResource()

Item Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.GetBondedResource ( Guid  volumeId)

Returns the Item resource binded to the certain volume.

Parameters
volumeIdGUID of volume provided by the service.
Returns
Item resource if found, null otherwise.

◆ GetEnumerator() [1/2]

IEnumerator< GridSpace > Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.GetEnumerator ( )

Enumerates grid entries.

Returns

◆ GetEnumerator() [2/2]

IEnumerator< Guid > Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.GetEnumerator ( Item  item)

Enumerator to access entire volumes bonded with the certain storage Item group.

Parameters
item
Returns
Enumerator of GridSpace ids.

◆ GetSizeSortedVolumes()

ICollection< GridSpace > Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.GetSizeSortedVolumes ( )
protected

Returns sorted collection of the located volumes in order from bigger volume to lower.

Returns
Sorted collection.

◆ GetSizeSortedVolumesIDs()

ICollection< Guid > Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.GetSizeSortedVolumesIDs ( )
protected

Returns sorted collection of the located volume IDs. in order from bigger volume to lower.

Returns
Sorted collection.

◆ IsVolumeCanFit()

bool Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.IsVolumeCanFit ( Volume  space)

Checks is the certain space can be received from the volume.

Parameters
space3 dimensional space demanded from the volume.
Returns
true in case if the space could be reserved. false otherwise.

◆ LoadSession()

override void Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.LoadSession ( byte[]  data)
virtual

Loads volumes to items dependency table.

Parameters
dataBinary data of previous session.

Reimplemented from Doloro.InvetorySystem.AEntityFeature.

◆ MakeBond()

void Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.MakeBond ( Guid  volumeId,
Item  resource 
)

Defines bond between grid volume and Item inside connected Storage.source.

Parameters
volumeIdId of the volume to bond definition.
resourceItem that should be considered as bonded with the volume.
Exceptions
ArgumentNullExceptionresource is null.
ArgumentExceptionvolumeId not found among registered.

◆ OnModified()

override void Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.OnModified ( )
protectedvirtual

Handler that should be called each time when property values have been modified.

Reimplemented from Doloro.InvetorySystem.AEntityFeature.

◆ OnStorageRented()

virtual void Doloro.InvetorySystem.AStorageFeature.OnStorageRented ( )
virtualinherited

◆ OnStorageRentOver()

virtual void Doloro.InvetorySystem.AStorageFeature.OnStorageRentOver ( )
virtualinherited

Occurs when rented storage released from the rent.

Use to clear entire members related to the certain source StoragesDatabase.StorageContainer binded to the storage.

Reimplemented in Doloro.InvetorySystem.Modules.Shops.ShopFeature, Doloro.InvetorySystem.Features.StorageInfo, and Doloro.InvetorySystem.Features.StorageLock.

◆ OnTrasactionMask()

override bool Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.OnTrasactionMask ( TransactionService.TransactionOrder  order)
virtual

Checking is the demanded volume can be placed in current free space.

Parameters
orderOrder that describes transfer requirements.
Returns
Is an entire volume can be placed.

Implements Doloro.InvetorySystem.AMaskStorageFeature.

◆ PlaceVolume() [1/2]

bool Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.PlaceVolume ( Volume  space,
Guid  volumeId 
)
protected

Reserves the space into the volume.

Parameters
space3 dimensional space demanded from the volume.
volumeIdId of the volume that should be related to the provided space.
Returns
Is the space was placed.

Using into internal operation in case if required volume revoke without modifying of GUID.

◆ PlaceVolume() [2/2]

bool Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.PlaceVolume ( Volume  space,
out Guid  volumeId 
)

Reserves the space into the volume.

Parameters
space3 dimensional space demanded from the volume.
volumeIdId of the shared space provided by register. Using to provide operation with the entity.
Returns
Is the space was placed.

◆ ReleaseVolume()

bool Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.ReleaseVolume ( Guid  volumeId,
bool  recomute 
)

Releases the volume by id and recomputes the space.

Parameters
volumeIdVolume's ID to remove.
recomuteIf true then will recompute entire volume order.

Set false in case you expecting the row of releases to prevent unnecessary operations. Yo can call RecomputeVolumesGrid manual.

Returns
true in case if the space successfully released. false in case if some external property prevent it from release.

◆ Reserve()

void Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.Reserve ( TransactionService.TransactionOrder  order)

Reserves internal capacity for possible transaction.

Parameters
orderOrder that defines resources that could be transfered to the agent.

Implements Doloro.InvetorySystem.IReservationAgent.

◆ SaveSession()

override byte[] Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.SaveSession ( )
virtual

Converts current items to volumes table to binary format.

Returns
Cross-session data in binary format.

Reimplemented from Doloro.InvetorySystem.AEntityFeature.

◆ SetDefault()

virtual void Doloro.InvetorySystem.AEntityFeature.SetDefault ( )
virtualinherited

Property Documentation

◆ FreeVolumesRegistry

List<GridSpace> Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.FreeVolumesRegistry = new List<GridSpace>()
getpackage

Collection of volumes available at the moment to receiving new entity.

Sorted from bigger Volume.size to lower.

◆ volume

Volume Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.volume
getset

3 dimensional space provided with the volume.

Shouldn't be less or equal to zero.

Event Documentation

◆ VolumeNotLongerFits

Action<Guid> Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.VolumeNotLongerFits
static

Occurs in case if the volume that was a part of the space no longer fits the space.

Could occurs during the RecomputeVolumesGrid handler.

Use to handle the object out of the provided space.


The documentation for this class was generated from the following files: