Doloro GDK 22 .1.0 Beta
by Tauri Interactive
|
Implements the conception of volume-like space bounding the capacity of the storage.
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< GridSpace > | GetEnumerator () |
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< GridSpace > | GetSizeSortedVolumes () |
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< GridSpace > | FreeVolumesRegistry = 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< AEntityFeature > | Modified |
Occurs when internal systems calling the OnModified handler. | |
void Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.CancelReservation | ( | TransactionService.TransactionOrder | order | ) |
Releases reservation holdings.
order | Order requested reservation previously. |
Implements Doloro.InvetorySystem.IReservationAgent.
object Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.Clone | ( | ) |
Clones the volume component on the new game object with disconnection it from the StoragesDatabase.
void Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.ConfirmReservation | ( | TransactionService.TransactionOrder | order | ) |
Changes reservation holdings state to permanent.
order | Order requested reservation previously. |
Implements Doloro.InvetorySystem.IReservationAgent.
|
protectedvirtual |
Applies the split instructions provided with the order to the FreeVolumesRegistry collection.
order | Instruction that provides computed zones. |
|
protected |
Looking for free space that fits most to required volume.
volumeToPlace | Volume to place. |
freeSpace | Recommended free space. |
true
in case if space found. false
otherwise.Item Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.GetBondedResource | ( | Guid | volumeId | ) |
IEnumerator< GridSpace > Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.GetEnumerator | ( | ) |
Enumerates grid entries.
IEnumerator< Guid > Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.GetEnumerator | ( | Item | item | ) |
|
protected |
Returns sorted collection of the located volumes in order from bigger volume to lower.
|
protected |
Returns sorted collection of the located volume IDs. in order from bigger volume to lower.
bool Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.IsVolumeCanFit | ( | Volume | space | ) |
Checks is the certain space can be received from the volume.
space | 3 dimensional space demanded from the volume. |
true
in case if the space could be reserved. false
otherwise.
|
virtual |
Loads volumes to items dependency table.
data | Binary data of previous session. |
Reimplemented from Doloro.InvetorySystem.AEntityFeature.
void Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.MakeBond | ( | Guid | volumeId, |
Item | resource | ||
) |
Defines bond between grid volume and Item inside connected Storage.source.
volumeId | Id of the volume to bond definition. |
resource | Item that should be considered as bonded with the volume. |
ArgumentNullException | resource is null. |
ArgumentException | volumeId not found among registered. |
|
protectedvirtual |
Handler that should be called each time when property values have been modified.
Reimplemented from Doloro.InvetorySystem.AEntityFeature.
|
virtualinherited |
The storage entity was rented with a new source StoragesDatabase.StorageContainer.
Reimplemented in Doloro.InvetorySystem.Features.StorageSlotsLimiter, and Doloro.InvetorySystem.Features.StorageWeightLimiter.
|
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.
|
virtual |
Checking is the demanded volume can be placed in current free space.
order | Order that describes transfer requirements. |
Implements Doloro.InvetorySystem.AMaskStorageFeature.
|
protected |
Reserves the space into the volume.
space | 3 dimensional space demanded from the volume. |
volumeId | Id of the volume that should be related to the provided space. |
Using into internal operation in case if required volume revoke without modifying of GUID.
bool Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.PlaceVolume | ( | Volume | space, |
out Guid | volumeId | ||
) |
Reserves the space into the volume.
space | 3 dimensional space demanded from the volume. |
volumeId | Id of the shared space provided by register. Using to provide operation with the entity. |
bool Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.ReleaseVolume | ( | Guid | volumeId, |
bool | recomute | ||
) |
Releases the volume by id and recomputes the space.
volumeId | Volume's ID to remove. |
recomute | If 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.
true
in case if the space successfully released. false
in case if some external property prevent it from release. void Doloro.InvetorySystem.Features.VolumetricSpace.StorageVolume.Reserve | ( | TransactionService.TransactionOrder | order | ) |
Reserves internal capacity for possible transaction.
order | Order that defines resources that could be transfered to the agent. |
Implements Doloro.InvetorySystem.IReservationAgent.
|
virtual |
Converts current items to volumes table to binary format.
Reimplemented from Doloro.InvetorySystem.AEntityFeature.
|
virtualinherited |
Sets default property values.
Reimplemented in Doloro.InvetorySystem.Modules.Shops.ShopFeature, Doloro.InvetorySystem.Features.StorageInfo, and Doloro.InvetorySystem.Features.StorageLock.
|
getpackage |
Collection of volumes available at the moment to receiving new entity.
Sorted from bigger Volume.size to lower.
|
getset |
3 dimensional space provided with the volume.
Shouldn't be less or equal to zero.
|
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.