forked from External/mage
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:
parent
991f154cd7
commit
1cbbcddcc6
32 changed files with 1615 additions and 786 deletions
23
Mage/src/main/java/mage/choices/VoteHandlerAI.java
Normal file
23
Mage/src/main/java/mage/choices/VoteHandlerAI.java
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package mage.choices;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface VoteHandlerAI<T> {
|
||||
|
||||
/**
|
||||
* AI choosing hints for votes
|
||||
*
|
||||
* @param voteHandler voting handler for choosing
|
||||
* @param aiPlayer player who must choose
|
||||
* @param aiDecidingPlayer real player who make a choice (cab be changed by another effect, example: Illusion of Choice)
|
||||
* @param aiSource
|
||||
* @param aiGame
|
||||
*/
|
||||
T makeChoice(VoteHandler<T> voteHandler, Player aiPlayer, Player aiDecidingPlayer, Ability aiSource, Game aiGame);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue