Codota Logo
AbstractGame
Code IndexAdd Codota to your IDE (free)

How to use
AbstractGame
in
com.jtbdevelopment.games.state

Best Java code snippets using com.jtbdevelopment.games.state.AbstractGame (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: com.jtbdevelopment.core-games/games

private Map<ID, Player<ID>> createIDMap(final U game) {
 return game.getAllPlayers().stream().collect(Collectors.toMap(Player::getId, p -> p));
}
origin: com.jtbdevelopment.core-games/games-web

 @Override
 protected IMPL handleActionInternal(
   final P player,
   final IMPL game,
   final Object param) {
  if (!game.getGamePhase().equals(GamePhase.RoundOver)) {
   throw new GameIsNotAvailableToRematchException();
  }

  game.setGamePhase(GamePhase.NextRoundStarted);
  return game;
 }
}
origin: com.jtbdevelopment.core-games/games

public int hashCode() {
 String idAsString = getIdAsString();
 return idAsString == null ? 0 : idAsString.hashCode();
}
origin: com.jtbdevelopment.core-games/games

@SuppressWarnings("WeakerAccess")
protected void copyFromPreviousGame(final IMPL previousGame, final IMPL newGame) {
 newGame.setRound(previousGame.getRound() + 1);
 newGame.setPreviousId(previousGame.getId());
}
origin: com.jtbdevelopment.core-games/games

protected void copyUnmaskedData(final U game, final M playerMaskedGame) {
 playerMaskedGame.setCompletedTimestamp(convertTime(game.getCompletedTimestamp()));
 playerMaskedGame.setCreated(convertTime(game.getCreated()));
 playerMaskedGame.setLastUpdate(convertTime(game.getLastUpdate()));
 playerMaskedGame.getFeatures().addAll(game.getFeatures());
 playerMaskedGame.setId(game.getIdAsString());
 playerMaskedGame.setGamePhase(game.getGamePhase());
 playerMaskedGame.setRound(game.getRound());
 playerMaskedGame.setPreviousId(game.getPreviousIdAsString());
}
origin: com.jtbdevelopment.core-games/games

 @SuppressWarnings("unused")
 protected IMPL changeStateAndReevaluate(final GamePhase transitionTo, final IMPL game) {
  game.setGamePhase(transitionTo);
  return evaluateGame(game);
 }
}
origin: com.jtbdevelopment.core-games/games

@Override
public IMPL evaluateGame(final IMPL game) {
 switch (game.getGamePhase()) {
  case Challenged:
   return evaluateChallengedPhase(game);
  case Setup:
   return evaluateSetupPhase(game);
  case Playing:
   return evaluatePlayingPhase(game);
  case RoundOver:
   return evaluateRoundOverPhase(game);
  case Declined:
   return evaluateDeclinedPhase(game);
  case NextRoundStarted:
   return evaluateNextRoundStartedPhase(game);
  case Quit:
   return evaluateQuitPhase(game);
 }
 return null;
}
origin: com.jtbdevelopment.core-games/games

public boolean equals(final Object o) {
 if (!(o instanceof Game)) {
  return false;
 }
 final Game game = (Game) o;
 return getId().equals(game.getId());
}
origin: com.jtbdevelopment.core-games/games-web

@SuppressWarnings("WeakerAccess")
protected void validatePlayerForGame(final IMPL game, final P player) {
 if (game instanceof MultiPlayerGame) {
  if (!game.getAllPlayers().contains(player)) {
   throw new PlayerNotPartOfGameException();
  }
 } else if (game instanceof SinglePlayerGame) {
  if (!((SinglePlayerGame) game).getPlayer().equals(player)) {
   throw new PlayerNotPartOfGameException();
  }
 }
}
origin: com.jtbdevelopment.core-games/games-events

@Override
public void gameChanged(
  final IMPL game,
  final P initiatingPlayer,
  final boolean initiatingServer) {
 if (initiatingServer) {
  ClusterMessage message = new ClusterMessage();
  message.setGameId(game.getIdAsString());
  message.setClusterMessageType(ClusterMessageType.GameUpdate);
  if (initiatingPlayer != null) {
   message.setPlayerId(initiatingPlayer.getIdAsString());
  }
  internalPublish(message);
 }
}
com.jtbdevelopment.games.stateAbstractGame

Javadoc

Date: 12/31/2014 Time: 5:25 PM

Most used methods

  • getAllPlayers
  • getGamePhase
  • getIdAsString
  • setGamePhase
  • getCompletedTimestamp
  • getCreated
  • getFeatures
  • getId
  • getLastUpdate
  • getPreviousIdAsString
  • getRound
  • setPreviousId
  • getRound,
  • setPreviousId,
  • setRound

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
  • onCreateOptionsMenu (Activity)
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Collectors (java.util.stream)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now