MockStendhalRPRuleProcessor.java :  » Game » Arianne-RPG-0.83 » games » stendhal » server » maps » Java Open Source

Java Open Source » Game » Arianne RPG 0.83 
Arianne RPG 0.83 » games » stendhal » server » maps » MockStendhalRPRuleProcessor.java
package games.stendhal.server.maps;

import games.stendhal.server.core.engine.PlayerList;
import games.stendhal.server.core.engine.StendhalRPRuleProcessor;
import games.stendhal.server.entity.player.Player;

public class MockStendhalRPRuleProcessor extends StendhalRPRuleProcessor {
 protected MockStendhalRPRuleProcessor() {
  
}
  public static MockStendhalRPRuleProcessor get() {
    if (!(instance instanceof MockStendhalRPRuleProcessor)) {
      instance = new MockStendhalRPRuleProcessor();
    }

    return (MockStendhalRPRuleProcessor) instance;
  }

  @Override
  public int getTurn() {
    return 0;
  }

  /**
   * Adds a player object to the list of players.
   *
   * @param player Player
   */
  public void addPlayer(final Player player) {
    this.onlinePlayers.add(player);
  }

  /**
   * reset the list of online players.
   */
  public void clearPlayers() {
    onlinePlayers = new PlayerList();
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.