Package net.shadewind.racetrack

Examples of net.shadewind.racetrack.Command


   * @param id the player ID
   * @param name the visible name of the player
   */
  public void newPlayer(int id, String name)
  {
    Command command = new Command("player");
    command.append(id);
    command.append(name);
    sendCommand(command);
  }
View Full Code Here


   * @param id The ID of the map.
   * @param name The name of the map.
   */
  public void mapAvailable(int id, String name)
  {
    Command command = new Command("availableMap");
    command.append(id);
    command.append(name);
    sendCommand(command);
  }
View Full Code Here

   *
   * @param gameMasterId  Notifies the client about which player is the game master.
   */
  public void lobby(int gameMasterId)
  {
    sendCommand(new Command("lobby").append(gameMasterId));
  }
View Full Code Here

   * @param map                The map that was chosen.
   * @param collisionsEnabled  Whether collisions are enabled.
   */
  public void gameStarted(RaceMap map, boolean collisionsEnabled)
  {
    Command command = new Command("gameStarted");
    command.append(map.toNetworkString());
    command.append(collisionsEnabled);
    sendCommand(command);
  }
View Full Code Here

   * @param playerId  The ID of the player.
   * @param pos       The position of the car.
   */
  public void carReset(int playerId, Vector2i pos)
  {
    Command command = new Command("carReset");
    command.append(playerId);
    command.append(pos.x());
    command.append(pos.y());
    sendCommand(command);
  }
View Full Code Here

   * @param playerId  The ID of the player.
   * @param timeout   The turn timeout.
   */
  public void playerTurn(int playerId, int timeout)
  {
    Command command = new Command("playerTurn");
    command.append(playerId);
    command.append(timeout);
    sendCommand(command);
  }
View Full Code Here

   * @param position  The new position.
   * @param velocity  The new velocity.
   */
  public void carDriven(int playerId, Vector2i position, Vector2i velocity)
  {
    Command command = new Command("carDriven");
    command.append(playerId);
    command.append(position.x());
    command.append(position.y());
    command.append(velocity.x());
    command.append(velocity.y());
    sendCommand(command);
  }
View Full Code Here

   *
   * @param playerId  The player ID.
   */
  public void carCrashed(int playerId)
  {
    sendCommand(new Command("carCrashed").append(playerId));
  }
View Full Code Here

   *
   * @param playerId  The player ID.
   */
  public void carFinished(int playerId)
  {
    sendCommand(new Command("carFinished").append(playerId));
  }
View Full Code Here

   *
   * @param highScores  The high scores to display to the player.
   */
  public void endGame(List<Score> highScores)
  {
    Command command = new Command("endGame");
    for (Score score : highScores)
      command.append(score.toString());
    sendCommand(command);
  }
View Full Code Here

TOP

Related Classes of net.shadewind.racetrack.Command

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.