diplomacy-0.2.0.0: Diplomacy board game

Copyright(c) Alexander Vieth 2015
LicenseBSD3
Maintaineraovieth@gmail.com
Stabilityexperimental
Portabilitynon-portable (GHC only)
Safe HaskellSafe
LanguageHaskell2010

Diplomacy.Occupation

Description

 

Synopsis

Documentation

type Occupation = Map Zone (Aligned Unit) Source #

Each Zone is occupied by at most one Aligned Unit, but the functions on Occupation work with ProvinceTarget; the use of Zone as a key here is just to guarantee that we don't have, for instance, units on both of Spain's coasts simultaneously.

occupier :: ProvinceTarget -> Occupation -> Maybe (Aligned Unit) Source #

Must be careful with this one! We can't just lookup the Zone corresponding to the ProvinceTarget; we must also check that the key matching that Zone, if there is one in the map, is also ProvinceTarget-equal.