本文整理汇总了Java中com.artemis.utils.Bag.remove方法的典型用法代码示例。如果您正苦于以下问题:Java Bag.remove方法的具体用法?Java Bag.remove怎么用?Java Bag.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.artemis.utils.Bag
的用法示例。
在下文中一共展示了Bag.remove方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unsubscribe
import com.artemis.utils.Bag; //导入方法依赖的package包/类
/**
* Unsubscribe T from entity.
*
* @param subscriber subscriber
* @param entityId entity to subscribe
*/
public void unsubscribe(T subscriber, int entityId) {
// unhook entity from subscriber
IntBag entities = subscriberEntities.get(subscriber);
if (entities != null) {
int index = entities.indexOf(entityId);
if ( index != -1 ) {
entities.remove(index);
}
}
// unhook subscriber from entity.
Bag<T> subscribers = entitySubscribers.get(entityId);
if (subscribers != null) {
subscribers.remove(subscriber);
}
}
示例2: removeFromPlayer
import com.artemis.utils.Bag; //导入方法依赖的package包/类
public void removeFromPlayer(Entity e) {
String player = playerByEntity.get(e);
if(player != null) {
Bag<Entity> entities = entitiesByPlayer.get(player);
if(entities != null) {
entities.remove(e);
}
}
}
示例3: removeFromTeam
import com.artemis.utils.Bag; //导入方法依赖的package包/类
public void removeFromTeam(String player) {
String team = teamByPlayer.remove(player);
if(team != null) {
Bag<String> players = playersByTeam.get(team);
if(players != null) {
players.remove(player);
}
}
}
示例4: remove
import com.artemis.utils.Bag; //导入方法依赖的package包/类
/**
* Remove the entity from the specified group.
* @param e
* @param group
*/
public void remove(Entity e, String group) {
Bag<Entity> entities = entitiesByGroup.get(group);
if(entities != null) {
entities.remove(e);
}
Bag<String> groups = groupsByEntity.get(e);
if(groups != null) {
groups.remove(group);
}
}
示例5: removeFromAllGroups
import com.artemis.utils.Bag; //导入方法依赖的package包/类
public void removeFromAllGroups(Entity e) {
Bag<String> groups = groupsByEntity.get(e);
if(groups != null) {
for(int i = 0; groups.size() > i; i++) {
Bag<Entity> entities = entitiesByGroup.get(groups.get(i));
if(entities != null) {
entities.remove(e);
}
}
groups.clear();
}
}
示例6: remove
import com.artemis.utils.Bag; //导入方法依赖的package包/类
/**
* Remove the entity from the specified group.
* @param e
* @param group
*/
public void remove(Entity e, String group) {
if (entitiesByGroup.containsKey(group)){
Bag<Entity> entities = entitiesByGroup.get(group);
entities.remove(e);
}
if (groupsByEntity.containsKey(e)){
Bag<String> groups = groupsByEntity.get(e);
groups.remove(group);
}
}
示例7: removeFromAllGroups
import com.artemis.utils.Bag; //导入方法依赖的package包/类
public void removeFromAllGroups(Entity e) {
if (groupsByEntity.containsKey(e)){
Bag<String> groups = groupsByEntity.get(e);
for(int i = 0; groups.size() > i; i++) {
Bag<Entity> entities = entitiesByGroup.get(groups.get(i));
if(entities != null) {
entities.remove(e);
}
}
groupsByEntity.remove(e);
}
}