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

How to use
Condition
in
mage.abilities.condition

Best Java code snippets using mage.abilities.condition.Condition (Showing top 20 results out of 315)

origin: magefree/mage

@Override
public boolean checkInterveningIfClause(Game game) {
  if (interveningIfClauseCondition != null) {
    return interveningIfClauseCondition.apply(game, this);
  }
  return true;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  if(!conditionChecked) {
    result = condition.apply(game, source);
    conditionChecked = true;
  }
  return result;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  return !condition.apply(game, source);
}
origin: magefree/mage

@Override
public boolean checkInterveningIfClause(Game game) {
  return condition.apply(game, this);
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  return conditions.stream().allMatch(condition -> condition.apply(game, source));
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  return conditions.stream().anyMatch(condition -> condition.apply(game, source));
}
origin: magefree/mage

@Override
public Effects getEffects(Game game, EffectType effectType) {
  if (!condition.apply(game, this)) {
    return emptyEffects;
  }
  return super.getEffects(game, effectType);
}
origin: magefree/mage

@Override
public Effects getEffects(Game game, EffectType effectType) {
  if (!condition.apply(game, this)) {
    return emptyEffects;
  }
  return super.getEffects(game, effectType);
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  if (condition.apply(game, source)) {
    return applyEffect(game, source);
  }
  return false;
}
origin: magefree/mage

@Override
public Effects getEffects(Game game, EffectType effectType) {
  if (!condition.apply(game, this)) {
    return emptyEffects;
  }
  return super.getEffects(game, effectType);
}
origin: magefree/mage

@Override
public Effects getEffects(Game game, EffectType effectType) {
  if (!condition.apply(game, this)) {
    return emptyEffects;
  }
  return super.getEffects(game, effectType);
}
origin: magefree/mage

@Override
public Effects getEffects(Game game, EffectType effectType) {
  if (!condition.apply(game, this)) {
    return emptyEffects;
  }
  return super.getEffects(game, effectType);
}
origin: magefree/mage

@Override
public boolean applies(GameEvent event, Ability source, Game game) {
  if (event.getTargetId().equals(source.getSourceId())) {
    if (condition == null || condition.apply(game, source)) {
      return true;
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean applies(GameEvent event, Ability source, Game game) {
  // has to return true, if the spell cannot be cast in the current phase / step
  if (event.getSourceId().equals(source.getSourceId())) {
    if (condition != null && !condition.apply(game, source)) {
      return true;
    }
  }
  return false; // cast not prevented by this effect
}
origin: magefree/mage

@Override
public boolean applies(Ability abilityToModify, Ability source, Game game) {
  if (abilityToModify.getSourceId().equals(source.getSourceId()) && (abilityToModify instanceof SpellAbility)) {
    return condition.apply(game, source);
  }
  return false;
}
origin: magefree/mage

@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
  return permanent.getId().equals(source.getSourceId()) && !condition.apply(game, source);
}
origin: magefree/mage

@Override
public ActivationStatus canActivate(UUID playerId, Game game) {
  if (!condition.apply(game, this)) {
    return ActivationStatus.getFalse();
  }
  return super.canActivate(playerId, game);
}
origin: magefree/mage

@Override
public Effects getEffects(Game game, EffectType effectType) {
  if (!condition.apply(game, this)) {
    return new Effects();
  }
  return super.getEffects(game, effectType);
}
origin: magefree/mage

@Override
public List<Mana> getNetMana(Game game, Ability source) {
  if (condition.apply(game, source)) {
    return effect.getNetMana(game, source);
  } else if (otherwiseEffect != null) {
    return otherwiseEffect.getNetMana(game, source);
  }
  return null;
}
origin: magefree/mage

@Override
public boolean applies(GameEvent event, Ability source, Game game) {
  if (((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD
      && event.getTargetId().equals(source.getSourceId())) {
    if (condition == null || condition.apply(game, source)) {
      return true;
    }
  }
  return false;
}
mage.abilities.conditionCondition

Javadoc

Interface describing condition occurrence.

Most used methods

  • apply
    Checks the game to see if this condition applies for the given ability.

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • setScale (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Runner (org.openjdk.jmh.runner)
  • Top 12 Jupyter Notebook Extensions
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