Table of Contents

Namespace Core.Queries

Classes

CountryQueries

High-performance country data access layer Provides optimized queries for country/nation information Performance: All basic queries <0.01ms, cached complex queries

ProvinceQueries

High-performance province data access layer Provides optimized queries for province information Performance: All basic queries <0.01ms, cached complex queries

Query

Static entry point for fluent query builders.

Usage: using var provinces = Query.Provinces(gameState) .OwnedBy(countryId) .IsLand() .Execute(Allocator.Temp);

using var countries = Query.Countries(gameState) .WithMinProvinces(5) .Execute(Allocator.Temp);

using var units = Query.Units(unitSystem) .OwnedBy(countryId) .InProvince(provinceId) .Execute(Allocator.Temp);

Structs

CountryQueryBuilder

Fluent query builder for country filtering. Lazy evaluation - filters are applied when terminal operation is called.

Usage: using var results = new CountryQueryBuilder(countrySystem, provinceSystem) .WithMinProvinces(5) .BorderingCountry(targetCountryId) .Execute(Allocator.Temp);

Performance: O(C) where C = countries, single pass with combined filters.

CountryStatistics

Country statistics for debugging and UI (engine-only data) Note: Development-related fields removed (game-specific) Use Game/Queries/HegemonCountryQueries for game statistics

ProvinceQueryBuilder

Fluent query builder for province filtering. Lazy evaluation - filters are applied when terminal operation is called.

Usage: using var results = new ProvinceQueryBuilder(provinceSystem) .OwnedBy(countryId) .IsLand() .Execute(Allocator.Temp);

Performance: O(P) where P = provinces, single pass with combined filters.

ProvinceStatistics

Province statistics for debugging and UI (engine-only data) Note: Development fields removed (game-specific)

QueryPerformanceStats

Query performance statistics

UnitQueryBuilder

Fluent query builder for unit filtering. Lazy evaluation - filters are applied when terminal operation is called.

Usage: using var results = new UnitQueryBuilder(unitSystem) .OwnedBy(countryId) .InProvince(provinceId) .Execute(Allocator.Temp);

Performance: O(U) where U = units, single pass with combined filters.

NOTE: This provides ENGINE-level queries (location, ownership, type ID). GAME layer should post-filter for game-specific concepts (unit class, combat role, etc.)