/*
* 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;
import java.io.File;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Map;
import java.util.TreeMap;
import java.util.logging.Logger;
import net.sf.l2j.Config;
import net.sf.l2j.L2DatabaseFactory;
import net.sf.l2j.gameserver.serverpackets.PledgeShowMemberListAll;
import net.sf.l2j.gameserver.serverpackets.PledgeStatusChanged;
import net.sf.l2j.gameserver.serverpackets.ServerBasePacket;
import net.sf.l2j.gameserver.serverpackets.SystemMessage;
public class L2Alliance
{
private static final Logger _log = Logger.getLogger(L2Alliance.class.getName());
private String _name;
private int _allianceId;
private L2Clan _leader;
private boolean _hasCrest;
/**
* called if a alliance is referenced only by id.
* in this case all other data needs to be fetched from db
* @param allyId
*/
public L2Alliance (int allianceId)
{
_allianceId = allianceId;
restore();
File crestFile = new File(Config.DATAPACK_ROOT, "data/crests/Alliance_"+_allianceId+".bmp");
_hasCrest = crestFile.exists();
}
/**
* this is only called if a new alliance is created
* @param allyId
* @param allyName
* @param leader
*/
public L2Alliance(int allyId, String allyName)
{
_allianceId = allyId;
_name = allyName;
}
/**
* @return Returns the clanId.
*/
public int getAllianceId()
{
return _allianceId;
}
/**
* @param clanId The clanId to set.
*/
public void setAllianceId(int allianceId)
{
_allianceId = allianceId;
}
/**
* @return Returns the name.
*/
public String getName()
{
return _name;
}
/**
* @param name The name to set.
*/
public void setName(String name)
{
_name = name;
}
}