TL;DR: This is a library intended to resolve orders issued in the game Diplomacy.
The engine is written to follow recommended rules from the Diplomacy Adjudicator Test Cases (DATC) site, with the exception that this engine does not permit ambiguous orders, and Civil Disobedience procedures are currently simplified.
To run the tests:
pip install pytest
pytest
Main concepts:
- The module
pydip.map
defines the map (classMap
), which contains territories and adjacencies.- Territories are either a
CoastTerritory
(with aparent
), aLandTerritory
(withcoasts
which may be empty for land-locked territories), or aSeaTerritory
. - The module also defines a class
SupplyCenterMap
(which additionally handles supply centers) and a classOwnershipMap
(which additionally handles owned and home territories)
- Territories are either a
- The module
pydip.player
defines players (classPlayer
) which have names and units (classUnit
). - The module
pydip.turn
defines functionsresolve_turn
,resolve_retreat
andresolve_adjustment
.
The file example.py
contains a script with comments to get you going.