Java Code Examples for javolution.util.FastMap#values()

The following examples show how to use javolution.util.FastMap#values() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: KillSpawned.java    From aion-germany with GNU General Public License v3.0 6 votes vote down vote up
public KillSpawned(int questId, List<Integer> startNpcIds, List<Integer> endNpcIds, FastMap<List<Integer>, SpawnedMonster> spawnedMonsters) {
	super(questId);
	this.questId = questId;
	this.startNpcs.addAll(startNpcIds);
	this.startNpcs.remove(0);
	if (endNpcIds == null) {
		this.endNpcs.addAll(startNpcs);
	}
	else {
		this.endNpcs.addAll(endNpcIds);
		this.endNpcs.remove(0);
	}
	this.spawnedMonsters = spawnedMonsters;
	this.spawnerObjects = new TIntArrayList();
	for (SpawnedMonster m : spawnedMonsters.values()) {
		spawnerObjects.add(m.getSpawnerObject());
	}
}
 
Example 2
Source File: MinionService.java    From aion-germany with GNU General Public License v3.0 5 votes vote down vote up
public void adoptMinion(Player player, Item item, String grade) {
	FastMap<Integer, MinionTemplate> minionTemplate =  new FastMap<Integer, MinionTemplate>();
	int minionId = 0;
	int minionLvl = 0;
	int minionGrowthPoints = 0;
	String minionName = "";
	String minionGrade = "";
	for (MinionTemplate template : DataManager.MINION_DATA.getMinionData().valueCollection()) {
		if (template.getGrade().equalsIgnoreCase(grade) && template.getLevel() == 1) {
			minionTemplate.put(template.getId(), template);
		}
	}
	int rnd = Rnd.get((int) 1, (int) minionTemplate.size());
	int i = 1;
	for (MinionTemplate mt : minionTemplate.values()) {
		if (i == rnd) {
			minionId = mt.getId();
			minionName = mt.getName();
			minionGrade = mt.getGrade();
			minionLvl = mt.getLevel();
			minionGrowthPoints = mt.getGrowthPt();
			break;
		}
		++i;
	}
	if (!validateAdoption(player, item.getItemTemplate(), minionId)) {
		return;
	}
	addMinion(player, minionId, minionName, minionGrade, minionLvl, minionGrowthPoints);
	player.getMinionList().updateMinionsList();
}
 
Example 3
Source File: Invasion.java    From aion-germany with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void addPlayer(Player player, boolean isInvader) {
	FastMap<Integer, Player> list = isInvader ? invaders : defenders;
	PlayerAlliance alliance = isInvader ? invAlliance : defAlliance;

	if (alliance != null && alliance.size() > 0) {
		PlayerAllianceService.addPlayer(alliance, player);
	}
	else if (!list.isEmpty()) {
		Player first = null;

		for (Player firstOne : list.values()) {
			if (firstOne.isInGroup2()) {
				PlayerGroupService.removePlayer(firstOne);
			}
			else if (firstOne.isInAlliance2()) {
				PlayerAllianceService.removePlayer(firstOne);
			}
			first = firstOne;
		}

		if (first.getObjectId() != player.getObjectId()) {
			if (isInvader) {
				invAlliance = PlayerAllianceService.createAlliance(first, player, TeamType.ALLIANCE_OFFENCE);
			}
			else {
				defAlliance = PlayerAllianceService.createAlliance(first, player, TeamType.ALLIANCE_DEFENCE);
			}
		}
		else {
			kickPlayer(player, isInvader);
		}
	}
	list.putEntry(player.getObjectId(), player);
}
 
Example 4
Source File: TransformationService.java    From aion-germany with GNU General Public License v3.0 5 votes vote down vote up
public void adoptTransformation(Player player, Item item, String grade) {
	FastMap<Integer, TransformationTemplate> transformationTemplate =  new FastMap<Integer, TransformationTemplate>();
	int transformationId = 0;
	String transformationName = "";
	String transformationGrade = "";
	for (TransformationTemplate template : DataManager.TRANSFORMATION_DATA.getTransformationData().valueCollection()) {
		if (template.getGrade().equalsIgnoreCase(grade)) {
			transformationTemplate.put(template.getId(), template);
		}
	}
	int rnd = Rnd.get((int) 1, (int) transformationTemplate.size());
	int i = 1;
	for (TransformationTemplate tt : transformationTemplate.values()) {
		if (i == rnd) {
			transformationId = tt.getId();
			transformationName = tt.getName();
			transformationGrade = tt.getGrade();
			break;
		}
		++i;
	}
	if (!validateAdoption(player, item.getItemTemplate(), transformationId)) {
		return;
	}
	addTransformation(player, transformationId, transformationName, transformationGrade);
	player.getTransformationList().updateTransformationsList();
}
 
Example 5
Source File: FindGroupService.java    From aion-germany with GNU General Public License v3.0 5 votes vote down vote up
private void cleanMap(FastMap<Integer, FindGroup> map, Race race, int action) {
	for (FindGroup group : map.values()) {
		if (group.getLastUpdate() + 60 * 60 < System.currentTimeMillis() / 1000) {
			removeFindGroup(race, action, group.getObjectId());
		}
	}
}