Package l2p.gameserver.instancemanager

Source Code of l2p.gameserver.instancemanager.UnderGroundColliseumManager

package l2p.gameserver.instancemanager;

import java.util.HashMap;
import java.util.logging.Logger;

import l2p.gameserver.model.L2Zone;
import l2p.gameserver.model.L2Zone.ZoneType;
import l2p.gameserver.model.entity.Coliseum;
import l2p.util.GArray;

public class UnderGroundColliseumManager
{
  protected static Logger _log = Logger.getLogger(UnderGroundColliseumManager.class.getName());
  private static UnderGroundColliseumManager _instance;
  private HashMap<Integer, Coliseum> _coliseums;

  public static UnderGroundColliseumManager getInstance()
  {
    if(_instance == null)
    {
      _instance = new UnderGroundColliseumManager();
    }
    return _instance;
  }

  public UnderGroundColliseumManager()
  {
    GArray<L2Zone> zones = ZoneManager.getInstance().getZoneByType(ZoneType.UnderGroundColiseum);
    if(zones.size() == 0)
    {
      _log.info("Not found zones for UnderGround Colliseum!!!");
    }
    else
    {
      for(L2Zone zone : zones)
      {
        getColiseums().put(zone.getIndex(), new Coliseum(zone.getIndex()));
      }
    }
    _log.info("Loaded: " + getColiseums().size() + " UnderGround Colliseums.");
  }

  public HashMap<Integer, Coliseum> getColiseums()
  {
    if(_coliseums == null)
    {
      _coliseums = new HashMap<Integer, Coliseum>();
    }
    return _coliseums;
  }

  public Coliseum getColiseumByLevelLimit(final int limit)
  {
    for(Coliseum coliseum : _coliseums.values())
    {
      if(coliseum.getMaxLevel() == limit)
      {
        return coliseum;
      }
    }
    return null;
  }
}
TOP

Related Classes of l2p.gameserver.instancemanager.UnderGroundColliseumManager

TOP
Copyright © 2018 www.massapi.com. 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.