lukemerrett / DiplomacyRules

Coding the rules of the Diplomacy board game in F#
MIT License
0 stars 0 forks source link

Map which countries border one another to validate move actions #6

Open lukemerrett opened 8 years ago

lukemerrett commented 8 years ago

How do we represent this in a clean way?

After this is done we need to finish the validator:

let moveFromToDestinationIsValid (move:RequestedMove, turn:CurrentTurnDetails) = 
    raise(NotImplementedException())
lukemerrett commented 8 years ago

I thought a cheap way to do this may be to have nested arrays creating X,Y co-ordinates, then storing the actual location in each region's record type. Less information stored and we could structure the data for faster lookup by x,y co-ords (e.g: dictionary).

However this doesn't work if you've got mulitple regions bordering a single, it doesn't necessarily translate into a grid.