root/trunk/AE-go_GameServer/src/com/aionemu/gameserver/model/templates/spawn/SpawnGroup.java
| 1369 | 1515 | ||
|---|---|---|---|
29 | import javax.xml.bind.annotation.XmlType; | 29 | import javax.xml.bind.annotation.XmlType; |
30 | 30 | ||
31 | import com.aionemu.commons.utils.Rnd; | 31 | import com.aionemu.commons.utils.Rnd; |
32 | import com.aionemu.gameserver.model.gameobjects.VisibleObject; | ||
32 | import com.aionemu.gameserver.spawnengine.SpawnHandlerType; | 33 | import com.aionemu.gameserver.spawnengine.SpawnHandlerType; |
33 | 34 | ||
34 | 35 | ||
... | ... | ||
212 | lastSpawnedTemplate.remove(instanceIndex); | 213 | lastSpawnedTemplate.remove(instanceIndex); |
213 | } | 214 | } |
214 | 215 | ||
216 | /** | ||
217 | * Check whether pool size is equal to number of defined objects | ||
218 | * For such pools no exchange template should be done | ||
219 | * | ||
220 | * @return | ||
221 | */ | ||
222 | public boolean isFullPool() | ||
223 | { | ||
224 | return pool == objects.size(); | ||
225 | } | ||
226 | |||
227 | /** | ||
228 | * @param visibleObject | ||
229 | */ | ||
230 | public synchronized void exchangeSpawn(VisibleObject visibleObject) | ||
231 | { | ||
232 | if(isFullPool()) | ||
233 | return; | ||
234 | |||
235 | int instanceId = visibleObject.getInstanceId(); | ||
236 | SpawnTemplate nextSpawn = getNextAvailableTemplate(instanceId); | ||
237 | if(nextSpawn != null) | ||
238 | visibleObject.setSpawn(nextSpawn); | ||
239 | } | ||
240 | |||
215 | } | 241 | } |
Download diff