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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
init
(com.badlogic.ashley.core.Engine e) com.badlogic.ashley.core.Entity
pop()
void
push
(com.badlogic.ashley.core.Entity food) Used internally, please useFoodStack.pushItem(Entity food)
instead.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.private void
setVisibility
(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, toArray
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
push
in interfaceDeque<com.badlogic.ashley.core.Entity>
- Overrides:
push
in classArrayDeque<com.badlogic.ashley.core.Entity>
-
pop
public com.badlogic.ashley.core.Entity pop()- Specified by:
pop
in interfaceDeque<com.badlogic.ashley.core.Entity>
- Overrides:
pop
in classArrayDeque<com.badlogic.ashley.core.Entity>
-
setVisibility
private void setVisibility(int size, com.badlogic.ashley.core.Entity e)
-