Code example for CopyOnWriteArraySet

0
	 
	public ScenePlayerManager(Scene scene,
			OnlinePlayerService onlinePlayerManager, int maxPlayerCount) {
		this.scene = scene;
		this.onlinePlayerManager = onlinePlayerManager;
		playerIds = new CopyOnWriteArraySet<Integer>();//maxPlayerCount
		 
		  
	} 
 
	public void add(Integer playerId) {
		playerIds.add(playerId); 
	} 
  
  
	/** 
	 * 设置id离开,不需要从online中删除,其他会地方会删除 
	 * @author xf 
	 */ 
	public boolean remove(Integer playerId) {
		if(playerId == null)return false;