All pastes #23458 Raw Edit

Someone

public text v1 · immutable
#23458 ·published 2005-09-20 18:50 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;

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(L2Clan.class.getName());

    private String _name;
    private int _allyId;
    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 allyId)
    {
        _allyId = allyId;
        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 clanName
     * @param leader
     */
    public L2Alliance(int allyId, String allianceName, L2Clan leader)
    {
        _allyId = allyId;
        _name = allianceName;
        setLeader(leader);
    }
    
    /**
     * @return Returns the clanId.
     */
    public int getAllianceId()
    {
        return _allyId;
    }
    
    /**
     * @param clanId The clanId to set.
     */
    public void setAllianceId(int allianceId)
    {
        _allyId = allianceId;
    }
    
    /**
     * @return Returns the leaderId.
     */
    public int getLeaderId()
    {
        return _leader.getObjectId();
    }
    
    /**
     * @param leaderId The leaderId to set.
     */
    public void setLeader(L2Clan leader)
    {
        _leader = leader;
    }
    
    /**
     * @return Returns the name.
     */
    public String getName()
    {
        return _name;
    }
    
    /**
     * @param name The name to set.
     */
    public void setName(String name)
    {
        _name = name;
    }
}