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

14481514
41
	
41
	
42
	/** A map containing all npc templates */
42
	/** A map containing all npc templates */
43
	private TIntObjectHashMap<PortalTemplate> portalData	= new TIntObjectHashMap<PortalTemplate>();
43
	private TIntObjectHashMap<PortalTemplate> portalData	= new TIntObjectHashMap<PortalTemplate>();
44
	private TIntObjectHashMap<PortalTemplate> worldIdPortalMap	= new TIntObjectHashMap<PortalTemplate>();
44
	
45
	
45
	void afterUnmarshal(Unmarshaller u, Object parent)
46
	void afterUnmarshal(Unmarshaller u, Object parent)
46
	{
47
	{
47
		for(PortalTemplate portal : portals)
48
		for(PortalTemplate portal : portals)
48
		{
49
		{
49
			portalData.put(portal.getNpcId(), portal);
50
			portalData.put(portal.getNpcId(), portal);
51
			worldIdPortalMap.put(portal.getExitPoint().getMapId(), portal);
50
		}
52
		}
51
		portals = null;
53
		portals = null;
52
	}
54
	}
...
...
56
		return portalData.size();
58
		return portalData.size();
57
	}
59
	}
58
	
60
	
59
	public PortalTemplate getPortalTemplate(int id)
61
	/**
62
	 * 
63
	 * @param npcId
64
	 * @return
65
	 */
66
	public PortalTemplate getPortalTemplate(int npcId)
60
	{
67
	{
61
		return portalData.get(id);
68
		return portalData.get(npcId);
62
	}
69
	}
70
	
71
	/**
72
	 * 
73
	 * @param worldId
74
	 * @return
75
	 */
76
	public PortalTemplate getPortalTemplateByMap(int worldId)
77
	{
78
		return worldIdPortalMap.get(worldId);
79
	}
80
	
81
	
63
}
82
}