root/trunk/AE-go_GameServer/src/com/aionemu/gameserver/dataholders/WorldMapsData.java

13691514
16
 */
16
 */
17
package com.aionemu.gameserver.dataholders;
17
package com.aionemu.gameserver.dataholders;
18
18
19
import gnu.trove.TIntObjectHashMap;
20
19
import java.util.Iterator;
21
import java.util.Iterator;
20
import java.util.List;
22
import java.util.List;
21
23
24
import javax.xml.bind.Unmarshaller;
22
import javax.xml.bind.annotation.XmlAccessType;
25
import javax.xml.bind.annotation.XmlAccessType;
23
import javax.xml.bind.annotation.XmlAccessorType;
26
import javax.xml.bind.annotation.XmlAccessorType;
24
import javax.xml.bind.annotation.XmlElement;
27
import javax.xml.bind.annotation.XmlElement;
...
...
40
{
43
{
41
	@XmlElement(name = "map")
44
	@XmlElement(name = "map")
42
	private List<WorldMapTemplate>	worldMaps;
45
	private List<WorldMapTemplate>	worldMaps;
46
	
47
	private TIntObjectHashMap<WorldMapTemplate>	worldIdMap	= new TIntObjectHashMap<WorldMapTemplate>();
48
	
49
	void afterUnmarshal(Unmarshaller u, Object parent)
50
	{
51
		for(WorldMapTemplate map : worldMaps)
52
		{
53
			worldIdMap.put(map.getMapId(), map);
54
		}
55
	}
43
56
44
	/**
57
	/**
45
	 * {@inheritDoc}
58
	 * {@inheritDoc}
...
...
59
	{
72
	{
60
		return worldMaps == null ? 0 : worldMaps.size();
73
		return worldMaps == null ? 0 : worldMaps.size();
61
	}
74
	}
75
	
76
	/**
77
	 * 
78
	 * @param worldId
79
	 * @return
80
	 */
81
	public WorldMapTemplate getTemplate(int worldId)
82
	{
83
		return worldIdMap.get(worldId);
84
	}
62
}
85
}