Skip to content

Extension points

tilttek/wargame-army

The package is at 0.x: its extension points are stable only from its 1.0 release. Until then, a minor version may change them, and its CHANGELOG says how.

PointWhat an application givesWhere
Contract\CatalogueProviderIts catalogues, by code; Catalog\InMemoryCatalogueProvider keeps them in memoryCatalogues and licences
Contract\ConstraintIts own rules, checked on every list after the catalogue'sConstraints

Every point is passed to a constructor; ArmyValidator keeps no state between two calls, and a constraint keeps none either. Contract\DeclaredConstraint is the interface of the constraints a catalogue declares in its data, which the library reads: Constraint\UnitCount and Constraint\PointsShare.