Class FoodStack
java.lang.Object
java.util.AbstractCollection<E>
java.util.ArrayDeque<com.badlogic.ashley.core.Entity>
com.devcharles.piazzapanic.utility.FoodStack
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<com.badlogic.ashley.core.Entity>,Collection<com.badlogic.ashley.core.Entity>,Deque<com.badlogic.ashley.core.Entity>,Queue<com.badlogic.ashley.core.Entity>
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(com.badlogic.ashley.core.Engine e) com.badlogic.ashley.core.Entitypop()voidpush(com.badlogic.ashley.core.Entity food) Used internally, please useFoodStack.pushItem(Entity food)instead.booleanpushItem(com.badlogic.ashley.core.Entity food, com.badlogic.ashley.core.Entity cook) Put a new food into inventory, use this instead ofFoodStack.push(Entity food)as it binds the item location to the player and maintains a maximum inventory size of 12.private voidsetVisibility(int size, com.badlogic.ashley.core.Entity e) Methods inherited from class java.util.ArrayDeque
add, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, forEach, getFirst, getLast, isEmpty, iterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, remove, remove, removeAll, removeFirst, removeFirstOccurrence, removeIf, removeLast, removeLastOccurrence, retainAll, size, spliterator, toArray, toArrayMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
containsAll, equals, hashCode, parallelStream, stream, toArray
-
Field Details
-
engine
private com.badlogic.ashley.core.Engine engine -
capacity
public final int capacity- See Also:
-
-
Constructor Details
-
FoodStack
public FoodStack()
-
-
Method Details
-
init
public void init(com.badlogic.ashley.core.Engine e) -
pushItem
public boolean pushItem(com.badlogic.ashley.core.Entity food, com.badlogic.ashley.core.Entity cook) Put a new food into inventory, use this instead ofFoodStack.push(Entity food)as it binds the item location to the player and maintains a maximum inventory size of 12.- Parameters:
food-cook-- Returns:
-
push
public void push(com.badlogic.ashley.core.Entity food) Used internally, please useFoodStack.pushItem(Entity food)instead.- Specified by:
pushin interfaceDeque<com.badlogic.ashley.core.Entity>- Overrides:
pushin classArrayDeque<com.badlogic.ashley.core.Entity>
-
pop
public com.badlogic.ashley.core.Entity pop()- Specified by:
popin interfaceDeque<com.badlogic.ashley.core.Entity>- Overrides:
popin classArrayDeque<com.badlogic.ashley.core.Entity>
-
setVisibility
private void setVisibility(int size, com.badlogic.ashley.core.Entity e)
-