Namespace Scylla.Core.Structures
Classes
GridUtil
Static utility class providing grid algorithms for all three Scylla grid topologies: square, hexagonal, and triangular. Covers distance computation, line rasterization, area queries, coordinate system conversions, geometric transformations, and topology-agnostic pathfinding primitives.
HexCornerMap<TData>
Lightweight dictionary wrapper that stores data keyed by HexCornerCoord. Useful for storing per-corner data such as settlements, trade posts, or elevation markers at hex vertices.
HexEdgeMap<TData>
Lightweight dictionary wrapper that stores data keyed by HexEdgeCoord. Useful for storing per-edge data such as walls, rivers, or road segments between adjacent hexes.
ScyllaAdjacencyListGraph
Primary mutable graph implementation using adjacency lists. Nodes are stored in a ScyllaMap<TKey, TValue> keyed by integer ID, and each node's outgoing edges are stored in a parallel ScyllaMap<TKey, TValue> of List<ScyllaGraphEdge>.
ScyllaAdjacencyListGraph.Builder
Fluent builder for constructing ScyllaAdjacencyListGraph instances with a readable, self-documenting configuration chain.
ScyllaAdjacencyListGraph.SynchronizedScyllaAdjacencyListGraph
Thread-safe decorator around ScyllaAdjacencyListGraph that serializes all graph operations through a shared lock object.
ScyllaAdjacencyListGraph<TNodeData>
Generic mutable adjacency list graph that associates an arbitrary user-data value of
type TNodeData with every node. All structural graph operations
are delegated to an internal ScyllaAdjacencyListGraph instance, while a
parallel ScyllaMap<TKey, TValue> stores the typed per-node payloads keyed
by node ID.
ScyllaAdjacencyListGraph<TNodeData, TEdgeData>
Generic mutable adjacency list graph that associates an arbitrary user-data value of
type TNodeData with every node and an arbitrary value of type
TEdgeData with every edge. Structural operations are delegated
to an internal ScyllaAdjacencyListGraph; per-node and per-edge payloads
are maintained in parallel ScyllaMap<TKey, TValue> stores.
ScyllaBVH
Managed Bounding Volume Hierarchy (BVH) wrapper providing convenient, validated access to spatial queries.
ScyllaBVH.Builder
Fluent builder for constructing ScyllaBVH instances with complex configurations. Supports allocator, multiple capacity parameters (item, node, query stack), and fattening margin.
ScyllaBitArray
Managed, fixed-capacity bit array backed by a ulong[] word array for compact
boolean storage and fast bitwise operations.
ScyllaBitArray.Builder
Fluent builder for constructing ScyllaBitArray instances with an optional synchronized wrapper.
ScyllaBitArray.SynchronizedScyllaBitArray
Thread-safe decorator that wraps a ScyllaBitArray and synchronizes every operation using a monitor lock on SyncRoot.
ScyllaBitArrayDOTS.Builder
Fluent builder for constructing ScyllaBitArrayDOTS instances.
ScyllaCSRGraph
Immutable, read-only graph stored in Compressed Sparse Row (CSR) format, optimized for cache-efficient traversal and high-frequency neighbor queries.
ScyllaCSRGraph.Builder
Fluent builder for constructing ScyllaCSRGraph instances incrementally, without requiring an intermediate mutable graph.
ScyllaCSRGraph<TNodeData>
Immutable CSR graph that stores arbitrary user data of type TNodeData
alongside each node, while delegating all topology queries to an inner
ScyllaCSRGraph.
ScyllaCSRGraph<TNodeData, TEdgeData>
Immutable CSR graph that stores arbitrary user data of type TNodeData
per node and TEdgeData per edge, while delegating all topology
queries to an inner ScyllaCSRGraph.
ScyllaCompositeState<TContext>
A state that owns a nested child state machine, forming one level of a hierarchical state machine. Entering the composite starts its child machine at the configured initial child state; exiting stops the child machine; ticks are forwarded to the active child.
ScyllaDequeDOTS<T>.Builder
Fluent builder for configuring and constructing ScyllaDequeDOTS<T> instances.
ScyllaDeque<T>
High-performance double-ended queue (deque) backed by a circular buffer. Supports O(1) amortized push and pop at both the front and the back, with O(1) peek at either end.
ScyllaDeque<T>.Builder
Fluent builder for constructing ScyllaDeque<T> instances with a readable, named-parameter-style configuration API.
ScyllaDeque<T>.SynchronizedScyllaDeque
Thread-safe decorator that wraps a ScyllaDeque<T> and serializes all operations
through a single lock statement, making every individual operation atomic.
ScyllaDisjointSet
A managed Union-Find (Disjoint Set Union) data structure backed by managed arrays, implementing both path compression and union-by-rank optimizations for near-constant-time amortized operations.
ScyllaDisjointSet.Builder
Provides a fluent API for configuring and constructing ScyllaDisjointSet instances, optionally wrapping the result in a ScyllaDisjointSet.SynchronizedScyllaDisjointSet for thread-safe use.
ScyllaDisjointSet.SynchronizedScyllaDisjointSet
A thread-safe decorator around ScyllaDisjointSet that serializes all operations through a single monitor lock.
ScyllaDisjointSetDOTS.Builder
Provides a fluent API for configuring and constructing ScyllaDisjointSetDOTS instances with a required allocator and an optional element count.
ScyllaGenericObjectPool<T>
High-performance object pool for any type T.
Stores available instances in an array-backed free-list (LIFO).
Unsynchronized by default; use AsSynchronized(object) to obtain a synchronized wrapper.
ScyllaGenericObjectPool<T>.Builder
Fluent builder for constructing ScyllaGenericObjectPool instances with complex configurations. Supports capacity, max size, creation function, callbacks (onGet, onRelease, onDestroy), collection checking, automatic creation, disposal on destroy, and synchronized wrapper creation.
ScyllaGenericObjectPool<T>.SynchronizedScyllaGenericObjectPool
Thread-safe wrapper around ScyllaGenericObjectPool<T> that synchronizes all operations using a lock.
ScyllaGraphAlgorithms
Static utility class providing fundamental graph algorithms that operate on any graph implementing IScyllaGraph or IScyllaReadOnlyGraph.
All algorithms are non-allocating where possible: a reusable edge buffer is grown
lazily on the stack of each call so that typical traversals avoid heap allocations
beyond the visited set and priority queue. The initial buffer size is
DEFAULT_EDGE_BUFFER_SIZE (16 edges); it is reallocated to exact size if a
node has more outgoing edges.
Algorithms that require a concrete node list (TopologicalSort(IScyllaGraph, out int[]), ConnectedComponents(IScyllaReadOnlyGraph, out ScyllaMap<int, int>), StronglyConnectedComponents(IScyllaReadOnlyGraph, out ScyllaMap<int, int>)) require the graph to implement IScyllaReadOnlyGraph so they can call CopyAllNodes(Span<ScyllaGraphNode>).
Complexity summaries use standard graph notation where V is the vertex
(node) count and E is the edge count.
ScyllaGraphDOTS.Builder
Fluent builder for constructing ScyllaGraphDOTS instances with readable, self-documenting configuration code.
Default configuration: directed graph, 64 node capacity, 256 edge capacity. The allocator is mandatory and must be set via WithAllocator(Allocator) before calling Build(); omitting it causes Build() to throw InvalidOperationException.
This class is nested inside ScyllaGraphDOTS for API consistency with other DOTS collection builders in the Scylla framework (e.g. ScyllaBitArrayDOTS.Builder, ScyllaDisjointSetDOTS.Builder).
ScyllaGraphPath
Represents the result of a graph path-finding search as an ordered sequence of node IDs and an accumulated traversal cost. An instance can be either valid - meaning a path was found - or invalid, meaning the search failed to connect source and target.
ScyllaGridGraphAdapter<TCoord, TCell>
Adapter that presents an IScyllaGrid<TCoord, TCell> as an IScyllaReadOnlyGraph, enabling standard graph algorithms to operate directly on grid data without building an explicit adjacency structure.
ScyllaHexGrid<TCell>
Dense, array-backed hexagonal grid storing per-cell data of type TCell.
Cells are addressed by HexCoord (axial q, r) with O(1) random access.
The grid covers a rectangular region in axial space defined by
(QMin..QMin+Width-1, RMin..RMin+Height-1).
Unsynchronized by default; use AsSynchronized(object) to obtain a thread-safe wrapper.
ScyllaHexGrid<TCell>.Builder
Fluent builder for constructing ScyllaHexGrid<TCell> instances with complex or convenient configurations. Call Build() to obtain an IScyllaGrid<TCoord, TCell> (which may be a synchronized wrapper), or BuildConcrete() to obtain the concrete ScyllaHexGrid<TCell> directly.
ScyllaHexGrid<TCell>.SynchronizedScyllaHexGrid
Thread-safe wrapper around ScyllaHexGrid<TCell> that serializes all read and write operations using a single monitor lock. Obtained via AsSynchronized(object) or the Synchronized(object) builder option.
ScyllaHierarchicalStateMachine<TContext>
A hierarchical state machine built from ScyllaCompositeState<TContext> states. Extends ScyllaStateMachine<TContext> with queries over the active root-to-leaf state chain.
ScyllaKDTree3
Burst/DOTS-friendly 3D KD-tree for nearest-neighbor queries over point sets.
Items are identified by an int itemID; payload is owned and stored by the caller.
ScyllaKDTree3.Builder
Fluent builder for configuring and constructing ScyllaKDTree3 instances.
ScyllaLayeredStateMachine<TContext>
A container for concurrent state machine layers sharing one context. Each layer is an independent ScyllaStateMachine<TContext> with its own current state; ticking the container ticks every layer in index order. Useful for agents that run orthogonal behaviors side by side (for example locomotion, stance, and vocalization).
ScyllaLooseOctree
Managed wrapper around ScyllaLooseOctreeCore. This wrapper owns the native containers and provides parameter validation and a convenience query scratch stack.
ScyllaLooseOctree.Builder
Fluent builder for configuring and constructing ScyllaLooseOctree instances.
ScyllaLooseOctreeUtil
Static math-only helpers for working with ScyllaLooseOctree and ScyllaLooseOctreeCore that are safe to call from Burst-compiled code.
ScyllaLooseOctree<T>
Typed wrapper around ScyllaLooseOctree that associates a payload of type
T with each item ID while keeping all spatial partitioning Burst-friendly.
ScyllaLooseQuadtree
Managed wrapper around ScyllaLooseQuadtreeCore that owns native container lifetime, enforces parameter invariants, and provides a built-in query scratch stack for convenient use from managed C# code without needing to supply a traversal buffer.
ScyllaLooseQuadtree.Builder
Fluent builder for incrementally configuring and constructing ScyllaLooseQuadtree instances. Obtain an instance via CreateBuilder().
ScyllaLooseQuadtreeUtil
Static utility methods for projecting 3D coordinates and building ScyllaAABB2 instances for use with the loose quadtree. All methods are pure math operations compatible with Burst compilation.
ScyllaLooseQuadtree<T>
Typed payload wrapper around ScyllaLooseQuadtree that associates an arbitrary
managed payload of type T with each integer item ID.
ScyllaMapDOTS<TKey, TValue>.Builder
Fluent builder for configuring and constructing ScyllaMapDOTS<TKey, TValue> instances.
ScyllaMap<TKey, TValue>
High-performance key/value map (dictionary-like) implemented with open addressing and linear probing over power-of-two-sized parallel arrays for keys, values, and slot state bytes.
ScyllaMap<TKey, TValue>.Builder
Fluent builder for constructing ScyllaMap instances with complex configurations. Supports capacity, fixed-capacity mode, custom key comparer, and synchronized wrapper creation.
ScyllaMap<TKey, TValue>.SynchronizedScyllaMap
Thread-safe wrapper around ScyllaMap<TKey, TValue> that synchronizes all operations using a lock.
ScyllaObjectPool<T>
High-performance pool for Unity objects (UnityEngine.Object). Stores inactive instances in an array-backed free-list (LIFO). Unsynchronized by default; use AsSynchronized(object) to obtain a synchronized wrapper.
ScyllaObjectPool<T>.Builder
Fluent builder for constructing ScyllaObjectPool instances with complex configurations. Supports prefab, capacity, max size, creation function, callbacks (onGet, onRelease, onDestroy), collection checking, automatic creation, and synchronized wrapper creation.
ScyllaObjectPool<T>.SynchronizedScyllaObjectPool
Thread-safe wrapper around ScyllaObjectPool<T> that synchronizes all operations using a lock.
ScyllaPausableStateBase<TContext>
Convenience base class for pausable states used with
ScyllaPushdownStateMachine<TContext>. All callbacks are virtual
no-ops (with CanEnter(TContext) returning
true), so implementations override only what they need.
ScyllaPriorityQueueDOTS<TValue>.Builder
Fluent builder for configuring and constructing ScyllaPriorityQueueDOTS<TValue> instances.
ScyllaPriorityQueueItemComparer<T>
A bridge comparer that adapts IScyllaPriorityQueueItem to the IComparer<T> interface required by ScyllaPriorityQueue<T>, ordering elements by their QueuePriority integer value.
ScyllaPriorityQueue<T>
High-performance priority queue backed by an array-based binary heap. By default this is a Min-heap (smallest item is highest priority), but Max-heap is also supported. Unsynchronized by default; use AsSynchronized(object) to obtain a thread-safe synchronized wrapper.
ScyllaPriorityQueue<T>.Builder
Fluent builder for constructing ScyllaPriorityQueue instances with complex configurations. Supports capacity configuration, fixed-capacity mode, heap ordering (min/max), custom comparer, and synchronized wrapper creation.
ScyllaPriorityQueue<T>.SynchronizedScyllaPriorityQueue
Thread-safe wrapper around ScyllaPriorityQueue<T> that synchronizes all operations using a single exclusive lock object.
ScyllaPushdownStateMachine<TContext>
A pushdown automaton extension of ScyllaStateMachine<TContext>: states can be pushed over the current state and popped again later, resuming the underlying state exactly where it was suspended. Useful for interruptible behavior such as "investigate, then return to patrol" without re-entering the patrol state.
ScyllaQueueDOTS<T>.Builder
Fluent builder for constructing a ScyllaQueueDOTS<T> with a discoverable, named-parameter configuration API.
ScyllaQueue<T>
High-performance FIFO queue backed by a circular buffer, with optional fixed-capacity mode, a thread-safe synchronized wrapper, and a fluent builder for configuration.
ScyllaQueue<T>.Builder
Fluent builder for constructing and optionally synchronizing a ScyllaQueue<T> with a discoverable, named-parameter configuration API.
ScyllaQueue<T>.SynchronizedScyllaQueue
Thread-safe wrapper around a ScyllaQueue<T> that serializes all operations through a single lock object.
ScyllaRingBufferDOTS<T>.Builder
Fluent builder for configuring and constructing ScyllaRingBufferDOTS<T> instances.
ScyllaRingBuffer<T>
High-performance fixed-capacity ring buffer backed by a circular array. Stores items in FIFO order (oldest-to-newest) and supports O(1) write, read, and peek operations.
ScyllaRingBuffer<T>.Builder
Fluent builder for constructing ScyllaRingBuffer<T> instances with complex configurations. Supports capacity configuration, overwrite-on-full mode, and optional synchronized wrapper creation.
ScyllaRingBuffer<T>.SynchronizedScyllaRingBuffer
Thread-safe wrapper around ScyllaRingBuffer<T> that synchronizes all operations using a lock.
ScyllaSparseHexGrid<TCell>
Sparse, dictionary-backed hexagonal grid storing per-cell data of type TCell.
Cells are addressed by HexCoord with O(1) average-case access.
Optionally bounded; unbounded grids can grow dynamically to any extent.
Unsynchronized by default; use AsSynchronized(object) to obtain a thread-safe wrapper.
ScyllaSparseHexGrid<TCell>.Builder
Fluent builder for constructing ScyllaSparseHexGrid<TCell> instances with
complex or convenient configurations.
Unlike the dense-grid builder, this builder does not offer WithDefaultValue because
sparse grids only store explicitly set cells and have no pre-allocated storage to fill.
ScyllaSparseHexGrid<TCell>.SynchronizedScyllaSparseHexGrid
Thread-safe wrapper around ScyllaSparseHexGrid<TCell> that serializes all read and write operations using a single monitor lock. Obtained via AsSynchronized(object) or the Synchronized(object) builder option.
ScyllaSparseSquareGrid<TCell>
Sparse, dictionary-backed square grid that stores per-cell data of type
TCell, addressed by SquareCoord.
ScyllaSparseSquareGrid<TCell>.Builder
Fluent builder for constructing ScyllaSparseSquareGrid<TCell> instances with configurable layout, optional bounds, and optional thread-safety.
ScyllaSparseSquareGrid<TCell>.SynchronizedScyllaSparseSquareGrid
Thread-safe wrapper around ScyllaSparseSquareGrid<TCell> that synchronizes every operation with a shared monitor lock.
ScyllaSparseTriGrid<TCell>
Sparse, dictionary-backed triangular grid that stores per-cell data of type
TCell only for cells that have been explicitly set.
ScyllaSparseTriGrid<TCell>.Builder
Fluent builder for constructing ScyllaSparseTriGrid<TCell> instances with complex or optional configuration.
ScyllaSparseTriGrid<TCell>.SynchronizedScyllaSparseTriGrid
Thread-safe wrapper around ScyllaSparseTriGrid<TCell> that serialises all read and write operations using a lock.
ScyllaSquareGrid<TCell>
Dense, array-backed square grid that stores one value of type TCell
per cell, addressed by SquareCoord (column, row).
ScyllaSquareGrid<TCell>.Builder
Fluent builder for constructing ScyllaSquareGrid<TCell> instances with configurable size, layout, default cell values, and optional thread-safety.
ScyllaSquareGrid<TCell>.SynchronizedScyllaSquareGrid
Thread-safe wrapper around ScyllaSquareGrid<TCell> that synchronizes every operation with a shared monitor lock.
ScyllaStackDOTS<T>.Builder
Fluent builder for configuring and constructing ScyllaStackDOTS<T> instances.
ScyllaStack<T>
High-performance LIFO (last-in, first-out) stack backed by a contiguous managed array buffer.
ScyllaStack<T>.Builder
Fluent builder for constructing ScyllaStack<T> instances with complex or explicit configurations.
ScyllaStack<T>.SynchronizedScyllaStack
Thread-safe wrapper around ScyllaStack<T> that serializes all operations
through a single lock object.
ScyllaStateBase<TContext>
Convenience base class for IScyllaState<TContext> implementations.
All callbacks are virtual no-ops and CanEnter(TContext) returns true,
so derived states only override the callbacks they need.
ScyllaStateMachine<TContext>
A lightweight, allocation-free finite state machine operating on a shared context. Exactly one state is current at a time; transitions run the exit callback of the old state followed by the enter callback of the new state.
ScyllaTransition<TContext>
Delegate-based convenience implementation of IScyllaTransition<TContext> for code-first machine construction and tests.
ScyllaTriGrid<TCell>
Dense, pre-allocated array-backed triangular grid that stores per-cell data of type
TCell, addressed by TriCoord lane coordinates.
ScyllaTriGrid<TCell>.Builder
Fluent builder for constructing ScyllaTriGrid<TCell> instances with complex or optional configuration.
ScyllaTriGrid<TCell>.SynchronizedScyllaTriGrid
Thread-safe wrapper around ScyllaTriGrid<TCell> that serialises all read and write operations using a lock.
ScyllaTrie
Concrete trie (prefix tree) that stores a set of strings with O(k) insert, lookup, and removal (where k is the key length), efficient prefix existence tests, and lexicographically ordered enumeration via CopyTo(Span<string>) and CopyMatches(string, Span<string>). This is the set variant; for key/value mapping use ScyllaTrie<TValue>. Unsynchronized by default; use AsSynchronized(object) to obtain a thread-safe wrapper.
ScyllaTrie.Builder
Fluent builder for constructing ScyllaTrie instances with complex configurations. Supports node capacity, fixed-capacity mode, case-insensitive matching, and synchronized wrapper creation.
ScyllaTrie.SynchronizedScyllaTrie
Thread-safe wrapper around ScyllaTrie that serialises all operations through a single monitor lock, making them safe for concurrent access from multiple threads. Obtain an instance via AsSynchronized(object) or Synchronized(object).
ScyllaTrie<TValue>
Concrete trie (prefix tree) that maps string keys to values of type TValue
with O(k) insert, lookup, and removal (where k is the key length), efficient prefix existence tests,
and lexicographically ordered enumeration via CopyKeysTo(Span<string>),
CopyKeyValuePairsTo(Span<KeyValuePair<string, TValue>>), and CopyMatches(string, Span<string>).
This is the map variant; for key-only set storage use ScyllaTrie.
Unsynchronized by default; use AsSynchronized(object) to obtain a thread-safe wrapper.
ScyllaTrie<TValue>.Builder
Fluent builder for constructing ScyllaTrie instances with complex configurations. Supports node capacity, fixed-capacity mode, case-insensitive matching, and synchronized wrapper creation.
ScyllaTrie<TValue>.SynchronizedScyllaTrie
Thread-safe wrapper around ScyllaTrie<TValue> that serialises all operations through a single monitor lock, making them safe for concurrent access from multiple threads. Obtain an instance via AsSynchronized(object) or Synchronized(object).
ScyllaTypeMap
High-performance type dictionary (type map) that stores values grouped by a CLR Type
and a uint numeric ID. Each distinct generic type argument T maps to a
dedicated per-type bucket internally backed by a ScyllaMap<TKey, TValue>, providing O(1)
average-case lookup, insertion, and removal without boxing.
ScyllaTypeMap.Builder
Fluent builder for constructing ScyllaTypeMap instances with complex configurations. Supports type capacity, bucket capacity, fixed-capacity mode, custom type comparer, and synchronized wrapper creation.
ScyllaTypeMap.SynchronizedScyllaTypeMap
Thread-safe wrapper around ScyllaTypeMap that synchronizes all operations using a lock.
SerializableDictionary<TKey, TValue>
A Dictionary<TKey, TValue> that survives Unity serialization. Unity's default serializer cannot persist generic dictionaries, so this type uses the standard UnityEngine.ISerializationCallbackReceiver two-list pattern to convert between the dictionary representation used at runtime and the parallel key/value lists used during serialization. Designers can edit the contents directly via a paired UI Toolkit drawer that displays the entries as a key-value table.
SquareCornerMap<TData>
Lightweight dictionary wrapper that stores arbitrary data keyed by SquareCornerCoord.
SquareEdgeMap<TData>
Lightweight dictionary wrapper that stores arbitrary data keyed by SquareEdgeCoord.
TriCornerMap<TData>
Lightweight dictionary wrapper that associates arbitrary data with corner vertices in a triangular grid, keyed by TriCornerCoord values.
TriEdgeMap<TData>
Lightweight dictionary wrapper that associates arbitrary data with edges in a triangular grid, keyed by canonical TriEdgeCoord values.
Structs
FractionalHexCoord
Represents a fractional (floating-point) coordinate in hexagonal cube space. Used as an intermediate value during world-to-grid conversion and line drawing, then rounded to the nearest HexCoord using the cube rounding algorithm.
HexCoord
Represents an axial coordinate in a hexagonal grid. Uses the axial (q, r) system where the third cube coordinate s = -q - r is computed on demand. This is the recommended storage format for hex grids (Amit Patel / Red Blob Games).
HexCornerCoord
Represents a canonical corner vertex in a hexagonal grid, identified by the anchor hex coordinate and the corner position (N or S).
HexCornerMap<TData>.Enumerator
Value-type enumerator for HexCornerMap<TData> enabling allocation-free
foreach iteration on the concrete type.
Yields (Coord, Value) tuples for all populated corners.
HexEdgeCoord
Represents a canonical edge in a hexagonal grid, identified by the anchor hex coordinate and the edge direction (E, NE, or NW).
HexEdgeMap<TData>.Enumerator
Value-type enumerator for HexEdgeMap<TData> enabling allocation-free
foreach iteration on the concrete type.
Yields (Coord, Value) tuples for all populated edges.
HexGridLayout
Defines the spatial layout for a hexagonal grid, providing conversion between axial hex coordinates and world-space positions. Supports both flat-top and pointy-top orientations. Uses precomputed 2x2 forward and inverse matrices for efficient O(1) conversion.
ScyllaAABB2
Blittable 2D axis-aligned bounding box used for broad-phase spatial queries in 2D and projected 3D spaces.
ScyllaAABB3
Blittable 3D axis-aligned bounding box (AABB) optimized for Burst compilation and DOTS contexts.
ScyllaAdjacencyListGraph.NodeEnumerator
Value-type enumerator for iterating over all ScyllaGraphNode entries
in the graph. Using the concrete ScyllaAdjacencyListGraph.NodeEnumerator type instead of
IEnumerator<ScyllaGraphNode> avoids heap allocation when used in a
foreach loop on the concrete ScyllaAdjacencyListGraph type.
ScyllaBVHCore
High-performance Bounding Volume Hierarchy (BVH) core for broad-phase spatial queries in 3D space.
ScyllaBitArray.Enumerator
Allocation-free value-type enumerator that yields the zero-based indices of all set bits in ascending order.
ScyllaBitArrayDOTS
DOTS/Burst-compatible fixed-capacity bit array backed by a NativeArray<ulong> word array. Provides the same bitwise operations as ScyllaBitArray in an unmanaged struct that is safe to use inside Burst-compiled jobs and on the job thread.
ScyllaBitArrayDOTS.Enumerator
Allocation-free, Burst-compatible value-type enumerator that yields the zero-based indices of all set bits in ascending order.
ScyllaDequeDOTS<T>
Burst- and DOTS-compatible fixed-capacity double-ended queue (deque) backed by a Unity.Collections.NativeArray<T> circular buffer. Supports O(1) push and pop at both ends with optional overwrite-on-full eviction semantics.
ScyllaDeque<T>.Enumerator
Value-type forward enumerator for ScyllaDeque<T> that allows allocation-free
foreach iteration over the concrete deque type.
ScyllaDisjointSetDOTS
A DOTS/Burst-compatible Union-Find (Disjoint Set Union) data structure backed by Unity.Collections.NativeArray<T> buffers, providing the same path compression and union-by-rank optimizations as ScyllaDisjointSet in a form suitable for use inside Burst-compiled jobs.
ScyllaGenericObjectPool<T>.Enumerator
Value-type enumerator for ScyllaGenericObjectPool<T> that enables allocation-free iteration.
ScyllaGraphDOTS
DOTS/Burst-compatible fixed-capacity graph stored in Compressed Sparse Row (CSR) format. Designed for read-heavy traversal in Unity Jobs and Burst-compiled code where managed heap allocations and garbage collection are unacceptable.
Lifecycle - two-phase build pattern:
-
Build phase: Call AddNode(int, ScyllaGraphNodeFlags) and AddEdge(int, int, float)
to populate the graph. During this phase, nodes and edges are accumulated in
NativeListbuffers for efficient appending. -
Finalize phase: Call BuildCSR() once all nodes and
edges have been added. This compacts the build lists into the immutable CSR
arrays and disposes the temporary build buffers. After this point,
AddNode(int, ScyllaGraphNodeFlags) and AddEdge(int, int, float) return
false.
CSR layout: Outgoing edges for node at dense index i are
stored in _edges[_edgeOffsets[i] .. _edgeOffsets[i+1]). This gives O(1)
neighbor access with a single range read - ideal for cache-coherent traversal in
job workers.
Undirected graphs: Each logical edge is stored twice internally (once in each direction) so that neighbor queries on either endpoint return the correct results. EdgeCount always reflects the logical count (each undirected edge counted once).
Disposal: This struct owns native memory and must be disposed by calling Dispose() when no longer needed. Failing to do so leaks unmanaged memory.
WARNING - shallow copy hazard: As a struct containing
NativeArray and NativeList fields, copying this value by assignment
creates a shallow copy where both copies reference the same native memory buffers.
Disposing one copy invalidates the other. Always pass by ref and avoid
struct assignment.
ScyllaGraphEdge
Lightweight, immutable edge descriptor for use with all Scylla graph structures.
Stores a directed connection from a source node to a target node along with a floating-point weight.
The struct is 12 bytes, fully unmanaged, and allocation-free - suitable for use in
Span<ScyllaGraphEdge> buffers and Unity DOTS NativeArray contexts.
ScyllaGraphEdge<TEdgeData>
A typed, immutable edge descriptor that pairs a ScyllaGraphEdge with
arbitrary user data of type TEdgeData. Use this variant when
graph edges need to carry domain-specific metadata - for example terrain type,
road classification, or animation triggers - without requiring a separate lookup table.
ScyllaGraphNode
Lightweight, immutable node descriptor for use with all Scylla graph structures.
Stores a unique integer identifier and a set of bitpacked ScyllaGraphNodeFlags
that describe per-node properties such as walkability and user-defined tags.
The struct is 8 bytes, fully unmanaged, and allocation-free - suitable for
Span<ScyllaGraphNode> buffers and Unity DOTS NativeArray contexts.
ScyllaGraphSearchState
Per-node state record used by graph traversal algorithms such as Dijkstra and A*. Tracks the best-known path cost from the source, the back-pointer used for path reconstruction, and the node's current position in the search frontier.
ScyllaHexGrid<TCell>.Enumerator
Value-type enumerator for ScyllaHexGrid<TCell> enabling allocation-free
foreach iteration on the concrete type.
Yields (Coord, Value) tuples in R-major order (iterates Q within each R row).
ScyllaKDTree3Core
Burst/DOTS-friendly core implementation of a 3D KD-tree for nearest-neighbor and radius queries.
ScyllaKDTree3Core.Node
Flat KD-tree node stored in a contiguous array.
ScyllaLooseOctreeCore
Burst-friendly loose octree core that stores items by integer ID and 3D AABBs. Intended for fast broad-phase queries (overlap/sphere/ray) and many moving items.
ScyllaLooseQuadtreeCore
Burst-compilable loose quadtree kernel that stores items by integer ID and 2D axis-aligned bounding boxes. Designed for fast broad-phase spatial queries (overlap, radius, ray) over large numbers of potentially moving items.
ScyllaMapDOTS<TKey, TValue>
Burst/DOTS-friendly fixed-capacity key/value map backed by a Unity Unity.Collections.NativeHashMap<TKey, TValue>. Designed for use in native job contexts and performance-critical systems where managed allocations and garbage collection must be avoided.
ScyllaMapEntry<TKey, TValue>
An unmanaged key/value pair used as the element type for ScyllaMapDOTS<TKey, TValue>.
Satisfies the unmanaged constraint so that it can be stored in native containers and passed
to Burst-compiled jobs without marshalling overhead.
ScyllaMap<TKey, TValue>.Enumerator
Value-type enumerator for ScyllaMap<TKey, TValue> that enables allocation-free
foreach iteration when the concrete map type is used directly (the compiler resolves
GetEnumerator() without going through an interface, avoiding heap allocation of the
enumerator box).
ScyllaObjectPool<T>.Enumerator
Value-type enumerator for ScyllaObjectPool<T> that enables allocation-free iteration.
ScyllaPriorityQueueDOTS<TValue>
Burst/DOTS-compatible, fixed-capacity priority queue backed by a Unity.Collections.NativeArray<T> binary heap. Supports both Min-heap and Max-heap ordering and provides deterministic FIFO tie-breaking for equal priorities.
ScyllaPriorityQueueNode<TValue>
A public-facing node that pairs an integer priority with an unmanaged payload value, used as the element type exposed by ScyllaPriorityQueueDOTS<TValue>.
ScyllaPriorityQueue<T>.Enumerator
A forward-only, value-type enumerator for ScyllaPriorityQueue<T> that enables
allocation-free iteration when used with the concrete queue type in a foreach loop.
ScyllaQueueDOTS<T>
Burst/DOTS-compatible fixed-capacity FIFO queue backed by a Unity.Collections.NativeArray<T> circular buffer.
ScyllaQueue<T>.Enumerator
Value-type enumerator for ScyllaQueue<T> that supports allocation-free
foreach iteration when used directly on the concrete queue type.
ScyllaRay3
Blittable 3D ray representation with precomputed inverse direction for efficient ray-AABB intersection tests.
ScyllaRingBufferDOTS<T>
Burst/DOTS-compatible fixed-capacity ring buffer backed by a Unity.Collections.NativeArray<T>. Stores items in FIFO order (oldest-to-newest) and supports O(1) add, remove, and peek operations.
ScyllaRingBufferDOTS<T>.Enumerator
Value-type forward enumerator for ScyllaRingBufferDOTS<T> that enables allocation-free, Burst-compatible iteration in oldest-to-newest (FIFO) order.
ScyllaRingBufferDOTS<T>.ReverseEnumerable
Lightweight wrapper struct that enables foreach loop support for reverse (newest-to-oldest)
iteration over a ScyllaRingBufferDOTS<T>.
ScyllaRingBufferDOTS<T>.ReverseEnumerator
Value-type reverse enumerator for ScyllaRingBufferDOTS<T> that enables allocation-free, Burst-compatible iteration in newest-to-oldest order.
ScyllaRingBuffer<T>.Enumerator
Value-type forward enumerator for ScyllaRingBuffer<T> that enables allocation-free iteration in oldest-to-newest (FIFO) order.
ScyllaRingBuffer<T>.ReverseEnumerable
Lightweight wrapper struct that enables foreach loop support for reverse (newest-to-oldest)
iteration over a ScyllaRingBuffer<T>.
ScyllaRingBuffer<T>.ReverseEnumerator
Value-type reverse enumerator for ScyllaRingBuffer<T> that enables allocation-free iteration in newest-to-oldest order.
ScyllaSparseHexGrid<TCell>.Enumerator
Value-type enumerator for ScyllaSparseHexGrid<TCell> enabling allocation-free
foreach iteration on the concrete type.
Yields (Coord, Value) tuples only for cells that have been explicitly set.
Iteration order follows the underlying dictionary (not deterministically ordered).
ScyllaSparseSquareGrid<TCell>.Enumerator
Value-type enumerator for ScyllaSparseSquareGrid<TCell> that enables
allocation-free foreach iteration when used on the concrete type.
ScyllaSparseTriGrid<TCell>.Enumerator
Value-type enumerator for ScyllaSparseTriGrid<TCell> that yields all explicitly populated cells without heap allocation.
ScyllaSquareGrid<TCell>.Enumerator
Value-type enumerator for ScyllaSquareGrid<TCell> that enables
allocation-free foreach iteration when used on the concrete type.
ScyllaStackDOTS<T>
Burst/DOTS-compatible fixed-capacity LIFO (last-in, first-out) stack backed by a Unity.Collections.NativeArray<T> of unmanaged elements.
ScyllaStack<T>.Enumerator
Value-type enumerator for ScyllaStack<T> that produces elements in top-to-bottom order without heap allocation.
ScyllaTriGrid<TCell>.Enumerator
Value-type enumerator for ScyllaTriGrid<TCell> that yields all cells in row-major order (downward triangle then upward triangle per rectangular position) without heap allocation.
ScyllaTypeMap.DiagnosticEntry
A single (type, id, value) entry captured by GetDiagnosticEntries(List<DiagnosticEntry>). The stored value is boxed into Value regardless of its bucket's value type.
SquareCoord
Represents an integer coordinate in a square grid, addressed by column and row.
SquareCornerCoord
Represents a corner vertex in a square grid.
SquareCornerMap<TData>.Enumerator
Value-type enumerator for SquareCornerMap<TData> that enables allocation-free
foreach iteration when used on the concrete type.
SquareEdgeCoord
Represents a unique, canonical edge in a square grid, identified by the anchor cell coordinate and the edge direction (N or W).
SquareEdgeMap<TData>.Enumerator
Value-type enumerator for SquareEdgeMap<TData> that enables allocation-free
foreach iteration when used on the concrete type.
SquareGridLayout
Defines the spatial layout of a square grid by specifying the physical size of each cell and the world-space position of the grid origin, and provides the conversions between grid coordinates and world-space positions.
TriCoord
Immutable coordinate for a cell in a triangular grid, expressed in three-axis lane
coordinates (A, B, C).
TriCornerCoord
Immutable coordinate for a corner vertex in a triangular grid, expressed in three-axis lane coordinates on the dual vertex sublattice.
TriCornerMap<TData>.Enumerator
Value-type enumerator for TriCornerMap<TData> that yields all stored corner entries without heap allocation.
TriEdgeCoord
Immutable canonical representation of a shared edge between two adjacent triangles in a triangular grid.
TriEdgeMap<TData>.Enumerator
Value-type enumerator for TriEdgeMap<TData> that yields all stored edge entries without heap allocation.
TriGridLayout
Defines the spatial layout for a triangular grid, encapsulating the triangle edge
length and world-space origin required to convert between TriCoord lane
coordinates and Unity world-space Vector2 positions.
Interfaces
IScyllaCollection
Base interface for all non-generic Scylla collection types. Provides a minimal, shape-agnostic contract that allows heterogeneous collections to be handled uniformly - for example, stored in a list, iterated, cleared, or introspected - without requiring knowledge of the concrete element type or collection topology.
IScyllaCollection<T>
Typed extension of IScyllaCollection that adds element-level operations for
collections that store items of a specific type T.
IScyllaGraph
Base interface for all Scylla graph types. Defines the minimal structural query contract - node and edge counts, property flags, containment tests, and allocation-free neighbor access - without implying mutability, enumeration, or typed node/edge payloads.
The inherited Count property returns NodeCount (the number of nodes), consistent with the primary collection element being nodes. Callers who need both counts should prefer the dedicated NodeCount and EdgeCount properties for clarity.
This interface sits at the root of a two-branch hierarchy. The read-only branch (IScyllaReadOnlyGraph) adds full inspection capabilities such as edge retrieval and bulk copy methods. The mutable branch (IScyllaMutableGraph) further extends the read-only branch with node and edge modification operations. Generic typed variants (IScyllaReadOnlyGraph<TNodeData>, IScyllaMutableGraph<TNodeData>) attach per-node and optionally per-edge user data to those branches.
The Properties flags describe fixed structural characteristics such as directionality and weightedness that are established at construction time and do not change during the lifetime of the graph.
IScyllaGrid<TCoord, TCell>
Base interface for all spatially-addressed Scylla grid collections. Extends IScyllaCollection with coordinate-keyed cell access and a topology-neutral contract that works identically for square, hexagonal, and triangular grid layouts.
IScyllaMap<TKey, TValue>
Common contract for key/value map collections (dictionary-like associative containers). Provides a minimal, allocation-free "try"-based surface for insertion, retrieval, and removal so that different map implementations - such as the managed open-addressing ScyllaMap<TKey, TValue> and the DOTS-native ScyllaMapDOTS<TKey, TValue> - can be used interchangeably through this interface.
IScyllaMutableGraph
Mutable graph interface that supports adding and removing nodes and edges, updating node flags, and pre-allocating storage capacity. Extends IScyllaReadOnlyGraph with structural mutation operations.
IScyllaMutableGraph<TNodeData>
Generic mutable graph interface that attaches typed user data to every node. Extends both IScyllaReadOnlyGraph<TNodeData> and IScyllaMutableGraph with node-data-aware mutation operations.
IScyllaMutableGraph<TNodeData, TEdgeData>
Generic mutable graph interface that attaches typed user data to both nodes and edges. Extends IScyllaReadOnlyGraph<TNodeData, TEdgeData> and IScyllaMutableGraph<TNodeData> with edge-data-aware mutation operations.
IScyllaPausableState<TContext>
Optional extension of IScyllaState<TContext> for states that want to be notified when a ScyllaPushdownStateMachine<TContext> pushes another state over them (OnPause(TContext)) and when they become current again after a pop (OnResume(TContext)).
IScyllaPriorityQueueItem
Optional interface for items that carry their own integer priority value, allowing them to be used directly with ScyllaPriorityQueue<T> without writing a custom IComparer<T>.
IScyllaReadOnlyGraph
Extended read-only inspection interface for graph structures. Adds individual edge retrieval, node flag access, and allocation-free bulk copy operations on top of the structural query contract established by IScyllaGraph.
IScyllaReadOnlyGraph<TNodeData>
Generic read-only graph interface that attaches typed user data to every node. Extends IScyllaReadOnlyGraph with per-node data retrieval.
IScyllaReadOnlyGraph<TNodeData, TEdgeData>
Generic read-only graph interface that attaches typed user data to both nodes and edges. Extends IScyllaReadOnlyGraph<TNodeData> with per-edge data retrieval and a typed allocation-free neighbor access overload.
IScyllaState<TContext>
Contract for a single state managed by a ScyllaStateMachine<TContext>. A state receives lifecycle callbacks when it becomes active or inactive and tick callbacks while it is the machine's current state.
IScyllaTransition<TContext>
A condition-driven transition toward a target state, evaluated by a ScyllaStateMachine<TContext> when registered as a global transition via AddGlobalTransition(IScyllaTransition<TContext>).
IScyllaTrie
Contract for a trie (prefix tree) that stores a set of strings with efficient prefix lookup and lexicographic enumeration. This is the set variant: keys have no associated value. For the key-value map variant see IScyllaTrie<TValue>.
IScyllaTrie<TValue>
Contract for a trie (prefix tree) that maps strings to values of type
TValue with efficient prefix lookup and lexicographic enumeration.
This is the map variant: each key is associated with exactly one value.
For the key-only set variant see IScyllaTrie.
Enums
HexCornerPosition
Canonical corner position for a hexagonal grid cell. Only two of the six corners are stored per hex to avoid duplication.
HexEdgeDirection
Canonical edge direction for a hexagonal grid cell. Only three of the six edges are stored per hex to avoid duplication.
HexLayoutMode
Describes how a rectangular hex region is arranged: as a slanted parallelogram or as an upright staggered rectangle. Used by region builders such as GetRectangularRegion(int, HexLayoutMode, HexOrientation, Span<HexCoord>) to choose which cells make up the region.
HexOrientation
Defines the orientation of hexagons in a hex grid, determining which axis has a flat edge versus a pointed vertex at the top of each cell.
ScyllaCollectionCapabilities
A FlagsAttribute bitfield enumeration that describes which optional operations a Scylla collection instance supports at runtime.
ScyllaCollectionThreadSafety
Enumerates the thread-safety guarantees that a Scylla collection instance provides for its operations.
ScyllaGraphNodeFlags
Bitpacked flags that describe the runtime properties of a ScyllaGraphNode.
The enum is backed by uint to provide 32 usable bits, and is decorated with
FlagsAttribute so that multiple values can be combined with bitwise operators.
ScyllaGraphProperties
Bitpacked flags that describe the structural capabilities and constraints of a IScyllaGraph instance. Graph implementations expose their properties through the Properties property, allowing algorithm code and application code to perform feature detection at runtime without casting to a concrete type.
ScyllaPriorityQueueOrder
Ordering mode for ScyllaPriorityQueue<T>.
ScyllaQuadtreePlane
Selects which axes are projected into ScyllaAABB2 when converting 3D coordinates for use with the loose quadtree's 2D spatial API.
SquareAdjacency
Defines the neighborhood model used to determine which cells are considered adjacent in a square grid.
SquareDistanceMetric
Identifies the distance formula used when computing distances between SquareCoord values.
SquareEdgeDirection
Identifies which of the two canonical edge orientations a SquareEdgeCoord represents relative to its anchor cell.
TriEdgeDirection
Identifies which of the three sides of a downward triangle an edge belongs to in a TriEdgeCoord.
Delegates
NeighborWriter<TCoord>
Delegate for writing the neighbors of a coordinate into a caller-supplied span buffer. Required because Span<T> is a ref struct and therefore cannot be used as a generic type argument in Func<T, TResult> or similar delegates.