09-17-2013, 06:17 PM
Ashe Написал:Ты бы уточнил о чём говоришь.
С 90% вероятностью что про это:
Код:
package l2m.gameserver.data.xml.holder;
import gnu.trove.TIntObjectHashMap;
import l2m.commons.data.xml.AbstractHolder;
import l2m.gameserver.model.Player;
import l2m.gameserver.model.base.Race;
import l2m.gameserver.model.base.Sex;
import l2m.gameserver.model.beautyshop.BeautyShopSet;
/**
* @author: Gaikotsu
*/
public final class BeautyShopHolder extends AbstractHolder
{
private static final BeautyShopHolder _instance = new BeautyShopHolder();
public static BeautyShopHolder getInstance()
{
return _instance;
}
private TIntObjectHashMap<BeautyShopSet> _sets = new TIntObjectHashMap<>();
public void addSet(BeautyShopSet set)
{
if (_sets.containsKey(set.getId()))
warn("Duplicate set declaration, set id - " + set.getId());
_sets.put(set.getId(), set);
}
public BeautyShopSet getSet(int id)
{
return _sets.get(id);
}
public BeautyShopSet getSet(Player player)
{
int id = -1;
[COLOR="Red"]switch (player.getRace())
{
case human:
id = player.getClassId().isMage() ? (player.getSex() == Sex.MALE.ordinal() ? 8 : 9) : (player.getSex() == Sex.MALE.ordinal() ? 0 : 1);
break;
case elf:
id = player.getSex() == Sex.MALE.ordinal() ? 6 : 7;
break;
case darkelf:
id = player.getSex() == Sex.MALE.ordinal() ? 2 : 3;
break;
case orc:
id = player.getClassId().isMage() ? (player.getSex() == Sex.MALE.ordinal() ? 12 : 13) : (player.getSex() == Sex.MALE.ordinal() ? 10 : 11);
break;
case dwarf:
id = player.getSex() == Sex.MALE.ordinal() ? 4 : 5;
break;
case kamael:
id = player.getSex() == Sex.MALE.ordinal() ? 14 : 15;
break;
}[/COLOR]
return getSet(id);
}
@Override
public int size()
{
return _sets.size();
}
@Override
public void clear()
{
_sets.clear();
}
@Override
public void log()
{
info(String.format("loaded %d beauty shop set(s) count.", size()));
}
}