Package l2p.gameserver.instancemanager

Source Code of l2p.gameserver.instancemanager.OlympiadStadiaManager

package l2p.gameserver.instancemanager;

import java.util.logging.Logger;

import l2p.gameserver.model.L2Zone;
import l2p.gameserver.model.L2Zone.ZoneType;
import l2p.gameserver.model.entity.olympiad.OlympiadStadia;
import l2p.util.GArray;

public class OlympiadStadiaManager
{
  protected static Logger _log = Logger.getLogger(OlympiadStadiaManager.class.getName());
  private static OlympiadStadiaManager _instance;

  public static OlympiadStadiaManager getInstance()
  {
    if(_instance == null)
    {
      System.out.println("Initializing OlympiadStadiaManager");
      _instance = new OlympiadStadiaManager();
      _instance.load();
    }
    return _instance;
  }

  private GArray<OlympiadStadia> _olympiadStadias;

  public void reload()
  {
    getOlympiadStadias().clear();
    load();
  }

  private void load()
  {
    GArray<L2Zone> zones = ZoneManager.getInstance().getZoneByType(ZoneType.OlympiadStadia);
    if(zones.size() == 0)
    {
      System.out.println("Not found zones for Olympiad!!!");
    }
    else
    {
      for(L2Zone zone : zones)
      {
        getOlympiadStadias().add(new OlympiadStadia(zone.getId()));
      }
    }
  }

  public final GArray<OlympiadStadia> getOlympiadStadias()
  {
    if(_olympiadStadias == null)
    {
      _olympiadStadias = new GArray<OlympiadStadia>();
    }
    return _olympiadStadias;
  }
}
TOP

Related Classes of l2p.gameserver.instancemanager.OlympiadStadiaManager

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.