12-17-2020, 05:00 AM
(This post was last modified: 12-17-2020, 05:03 AM by dale walton.)
For multi player games, some moves may cause a need to update all the scores by means of a function, (or possibly to affect other players' pieces in the consequences)
The player iterator is for all the moves of the players and doesn't have its own iterator value, and I don't know how it would affect game flow if used it in a consequence.
I suggest a Who iterator that iterates over players without invoking their moves:
For example: to update the scores of players with pieces in the vicinity of a moved piece:
(forEach Who In:(sites Around (to)) (set Score (who) (count Pieces (who))))
And maybe also
(forEach Who Team1 (set Score (who) (count Pieces (who))))
i.e iterator for Player roles ...
The player iterator is for all the moves of the players and doesn't have its own iterator value, and I don't know how it would affect game flow if used it in a consequence.
I suggest a Who iterator that iterates over players without invoking their moves:
For example: to update the scores of players with pieces in the vicinity of a moved piece:
(forEach Who In:(sites Around (to)) (set Score (who) (count Pieces (who))))
And maybe also
(forEach Who Team1 (set Score (who) (count Pieces (who))))
i.e iterator for Player roles ...