public class EntityContainer<T extends Indexable<T>> extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
protected List<T> |
entities |
protected Map<String,Integer> |
names |
protected List<Double> |
weights |
| Constructor and Description |
|---|
EntityContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(T entity) |
void |
add(T entity,
double weight) |
void |
addAll(T... entities) |
T |
any(RandEngine randEngine) |
T |
anyOther(T excluded,
RandEngine rand) |
void |
copy(EntityContainer<T> that) |
boolean |
equals(Object o) |
T |
get(int index) |
T |
get(String name) |
double |
getWeight(int index) |
int |
hashCode() |
int |
size() |
double |
weightSum() |
public double weightSum()
public T anyOther(T excluded, RandEngine rand)
public T get(int index)
public int size()
public void add(T entity, double weight)
public void add(T entity)
public void copy(EntityContainer<T> that)
public T any(RandEngine randEngine)
public double getWeight(int index)
public void addAll(T... entities)
Copyright © 2017. All rights reserved.