snakeprogram3d
Class MultipleSnakesStore
java.lang.Object
snakeprogram3d.MultipleSnakesStore
- All Implemented Interfaces:
- java.lang.Iterable<Snake>
public class MultipleSnakesStore
- extends java.lang.Object
- implements java.lang.Iterable<Snake>
This class should be replaced with a linkedlist since that is all
it contains.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MultipleSnakesStore
public MultipleSnakesStore()
addSnake
public void addSnake(Snake snk)
deleteSnake
public void deleteSnake(Snake snk)
deleteSnake
public void deleteSnake(int index)
getSnake
public Snake getSnake(int index)
getNumberOfSnakes
public int getNumberOfSnakes()
getLastSnake
public Snake getLastSnake()
iterator
public java.util.Iterator<Snake> iterator()
- Specified by:
iterator
in interface java.lang.Iterable<Snake>
getNextSnake
public Snake getNextSnake(Snake current)
purgeSnakes
public void purgeSnakes()
- remove empty snakes
contains
public boolean contains(Snake s)