congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Player.getTurnControlledBy
Code IndexAdd Tabnine to your IDE (free)

How to use
getTurnControlledBy
method
in
mage.players.Player

Best Java code snippets using mage.players.Player.getTurnControlledBy (Showing top 4 results out of 315)

origin: magefree/mage

  public static List<UUID> split(Game game, UUID playerId) {
    List<UUID> players = new ArrayList<>();
    //players.add(playerId); // add original player
    Player player = game.getPlayer(playerId);
    if (player != null && player.getTurnControlledBy() != null) {
      players.add(player.getTurnControlledBy());
    }
    return players;
  }
}
origin: magefree/mage

@Override
public void resetControlAfterSpellResolve(UUID topId) {
  // for Word of Command
  Spell spell = getSpellOrLKIStack(topId);
  if (spell != null) {
    if (spell.getCommandedBy() != null) {
      UUID commandedBy = spell.getCommandedBy();
      UUID spellControllerId = null;
      if (commandedBy.equals(spell.getControllerId())) {
        spellControllerId = spell.getSpellAbility().getFirstTarget(); // i.e. resolved spell is Word of Command
      } else {
        spellControllerId = spell.getControllerId(); // i.e. resolved spell is the target opponent's spell
      }
      if (spellControllerId != null) {
        Player turnController = getPlayer(commandedBy);
        if (turnController != null) {
          Player targetPlayer = getPlayer(spellControllerId);
          if (targetPlayer != null) {
            targetPlayer.setGameUnderYourControl(true, false);
            informPlayers(turnController.getLogName() + " lost control over " + targetPlayer.getLogName());
            if (targetPlayer.getTurnControlledBy().equals(turnController.getId())) {
              turnController.getPlayersUnderYourControl().remove(targetPlayer.getId());
            }
          }
        }
      }
      spell.setCommandedBy(null);
    }
  }
}
origin: magefree/mage

this.isGameUnderControl = player.isGameUnderControl();
this.turnController = player.getTurnControlledBy();
this.turnControllers.clear();
this.turnControllers.addAll(player.getTurnControllers());
origin: magefree/mage

  controller = game.getPlayer(wordOfCommand.getCommandedBy());
} else {
  controller = game.getPlayer(sourceController.getTurnControlledBy());
if (!targetPlayer.getTurnControlledBy().equals(controller.getId())) {
  controller.getPlayersUnderYourControl().remove(targetPlayer.getId());
mage.playersPlayergetTurnControlledBy

Popular methods of Player

  • getId
  • getHand
  • getName
  • getLife
  • getLibrary
  • hasLeft
  • hasWon
  • getCounters
  • hasLost
  • copy
  • damage
  • declareAttacker
  • damage,
  • declareAttacker,
  • getGraveyard,
  • getPlayersUnderYourControl,
  • activateAbility,
  • canLose,
  • choose,
  • declareBlocker,
  • gainLife,
  • getAttachments

Popular in Java

  • Start an intent from android
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now