12-20-2020, 04:10 PM
(This post was last modified: 12-20-2020, 04:12 PM by dale walton.)
For a game with varying numbers of players and multi decision turns, I need to find the previous player because the mover has of a special relationship with the previous player's pieces.
1) Your documentation seems gives no guidance as to whether (prev) is whichever play moved on the last turn or is the player with the next lower index. - but (is Prev Mover) (also shown in the documentation as (isPrev Mover)) makes me believe (prev) must be who ever moved in the previous turn - which is not what I need.
Is that correct?
2) The documentation shows the map function can be used to map roles. Thus I set up a role mapping to find the previous player with a mapEntry function. However this did not work. Why?
(equipment
{
(map "PrevPlayer"
{
(pair P2 P1)
(pair P3 P2)
(pair P1 P3)
}
)
}
...
(between if:(is Within (id "Hex" (mapEntry "PrevPlayer" Mover) ) at:(between))
...
Unexpected syntax '(mapEntry "PrevPlayer...' in '(id "Hex" (mapEntry "PrevPlayer...'.
(sites Occupied by:(mapEntry "PrevPlayer" Mover) component:"Disc")
gave:
Unexpected syntax 'by:(mapEntry "PrevPla...' in '(sites Occupied by:(mapEntry ...'.
Please note I also tried various combinations of (player (...)) with this, but that didn't help.
If it should work, what is the proper syntax?
1) Your documentation seems gives no guidance as to whether (prev) is whichever play moved on the last turn or is the player with the next lower index. - but (is Prev Mover) (also shown in the documentation as (isPrev Mover)) makes me believe (prev) must be who ever moved in the previous turn - which is not what I need.
Is that correct?
2) The documentation shows the map function can be used to map roles. Thus I set up a role mapping to find the previous player with a mapEntry function. However this did not work. Why?
(equipment
{
(map "PrevPlayer"
{
(pair P2 P1)
(pair P3 P2)
(pair P1 P3)
}
)
}
...
(between if:(is Within (id "Hex" (mapEntry "PrevPlayer" Mover) ) at:(between))
...
Unexpected syntax '(mapEntry "PrevPlayer...' in '(id "Hex" (mapEntry "PrevPlayer...'.
(sites Occupied by:(mapEntry "PrevPlayer" Mover) component:"Disc")
gave:
Unexpected syntax 'by:(mapEntry "PrevPla...' in '(sites Occupied by:(mapEntry ...'.
Please note I also tried various combinations of (player (...)) with this, but that didn't help.
If it should work, what is the proper syntax?