All pastes #708286 Raw Edit

Ahmed

public java v1 · immutable
#708286 ·published 2007-09-23 18:56 UTC
rendered paste body
/* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * http://www.gnu.org/copyleft/gpl.html */package net.sf.l2j.gameserver.model.entity;import net.sf.l2j.Config;import net.sf.l2j.gameserver.ThreadPoolManager;/** This class organizes and calls upon ALL event tasks for the L2J Oneo Event Automation System. * * * @author  Ahmed */public class L2JOneoEventManager{	public static int Event = 1;	private static L2JOneoEventManager _instance = null;	public L2JOneoEventManager()	{		L2JOneoEventManager();	}	public void L2JOneoEventManager()	{		if (!Config.TVT_EVENT_ENABLED && !Config.VIP_EVENT_ENABLED)		{			return;		}		else if (Config.TVT_EVENT_ENABLED && !Config.VIP_EVENT_ENABLED)		{				System.out.println("L2J Oneo Event Manager starting TvT Task.");				ThreadPoolManager.getInstance().scheduleGeneral(new TvTTask(), 0);		}		else if (Config.VIP_EVENT_ENABLED && !Config.TVT_EVENT_ENABLED)		{				System.out.println("L2J Oneo Event Manager starting VIP Task.");				ThreadPoolManager.getInstance().scheduleGeneral(new VipTask(), 0);		}		else if (Config.VIP_EVENT_ENABLED && Config.TVT_EVENT_ENABLED)		{			if (Event == 1)			{				ThreadPoolManager.getInstance().scheduleGeneral(new TvTTask(), 0);				Event = 2;			}		}		else if (Config.VIP_EVENT_ENABLED && Config.TVT_EVENT_ENABLED)		{			if (Event == 2)			{				ThreadPoolManager.getInstance().scheduleGeneral(new VipTask(), 0);				Event = 1;			}		}	}	public static L2JOneoEventManager getInstance()	{		if (_instance == null)		{            System.out.println("Initializing L2JOneo Event Manager");			_instance = new L2JOneoEventManager();		}		return _instance;	}}