Improving implementation of cards which use voting (WIP) (#7566)

* created interface for handling voting

* created class for two choice votes, refactored a card to use it

* refactored all cards which use two choice votes

* updated VoteHandler to an abstract class to encapsulate more of its functions

* refactored cards which vote for more than two things

* [CNS] Implemented Brago's Representative

* [CN2] Implemented Ballot Broker

* [CN2] Implemented Illusion of Choice

* [CNS] Implemented Grudge Keeper

* added vote outcomes

* updated implementation of Illusion of Choice to work correctly in multiples

* added test for voting

* updated implementation of extra votes

* simplified vote message handling

* Improved names, additional comments

* Votes: fixed not working getMostVoted

* Votes: added final vote results to game logs;

* Votes: added additional info for the vote choices;

* Votes: added vote step info in choose dialogs, added AI support example for Tyrant's Choice;

Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
This commit is contained in:
Evan Kranzler 2021-03-20 10:32:54 -04:00 committed by GitHub
parent 991f154cd7
commit 1cbbcddcc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 1615 additions and 786 deletions

View file

@ -437,6 +437,14 @@ public class GameEvent implements Serializable {
//combat events
COMBAT_DAMAGE_APPLIED,
SELECTED_ATTACKER, SELECTED_BLOCKER,
/* voting
targetId player who voting
sourceId sourceId of the effect doing the voting
playerId player who deciding about voting, can be changed by replace events
amount not used for this event
flag not used for this event
*/
VOTE, VOTED,
//custom events
CUSTOM_EVENT
}