GeometryCache
GeometryCache
Thread-safe geometry cache for storing and retrieving computed geometric data. Improves performance by caching expensive geometric calculations.
Project: GridPlacement v6.0
Layer: Godot
Source: Godot/Core/_incomplete/Services/DI/GeometryCache.cs
Namespace: GridBuilding.Core.Services.DI
Kind: class
Parsing Method: AST-based (Roslyn) - NOT regex
⚠️ IMPORTANT: This documentation was generated using AST parsing, not regex.
Properties
Count
Gets the number of entries currently in the cache (including expired ones).
ActiveCount
Gets the number of non-expired entries in the cache.
Methods
GetOrCreate
Gets or creates a cached value using a factory function.
Returns: T
Parameters:
string keyFunc<T> factoryTimeSpan? expiration
TryGet
Gets a value from the cache if it exists and is not expired.
Returns: bool
Parameters:
string keyT? value
Set
Stores a value in the cache with optional expiration.
Returns: void
Parameters:
string keyT valueTimeSpan? expiration
Remove
Removes a value from the cache.
Returns: bool
Parameters:
string key
Contains
Checks if a key exists in the cache and is not expired.
Returns: bool
Parameters:
string key
ClearExpired
Clears all expired entries from the cache.
Returns: int
Clear
Clears all entries from the cache.
Returns: void
GetStats
Gets cache statistics for monitoring.
Returns: CacheStats
Dispose
Returns: void
GetCachedDistance
Caches distance calculations between positions.
Returns: int
Parameters:
CoreVector2I fromCoreVector2I toFunc<CoreVector2I, CoreVector2I, int> calculator
GetCachedPositionsInRadius
Caches positions in radius calculations.
Returns: CoreVector2I[]
Parameters:
CoreVector2I centerint radiusFunc<CoreVector2I, int, CoreVector2I[]> calculator
GetCachedRectangleOverlap
Caches rectangle overlap calculations.
Returns: bool
Parameters:
CoreVector2I pos1CoreVector2I size1CoreVector2I pos2CoreVector2I size2Func<CoreVector2I, CoreVector2I, CoreVector2I, CoreVector2I, bool> calculator