Skip navigation links
A C D E G I M O P R S T 

A

add(AnyType) - Method in class MyList
Inserts a value at the end of the list.
add(AnyType) - Method in interface SimpleList
Inserts an element at the end of the list.
allGone() - Method in class Pellets
Determine whether all of the pellets have been consumed.

C

canMove(Point) - Method in class SnakesGame
Determine whether the given point is free (so that a snake can move onto it).

D

dequeue() - Method in class MyList
Retrieves and removes the first element of the queue
dequeue() - Method in interface SimpleQueue
Retrieves and removes the first element of the queue

E

enqueue(AnyType) - Method in class MyList
Inserts a value at the end of the queue
enqueue(AnyType) - Method in interface SimpleQueue
Inserts an element at the end of the queue

G

getScore() - Method in class Snake
Get the snake's score.

I

isEmpty() - Method in class MyList
Determine whether the list is empty.
isEmpty() - Method in interface SimpleList
Determines whether the list is empty.
isEmpty() - Method in interface SimpleQueue
Determines if the queue has no elements
iterator() - Method in class MyList
Returns an Iterator object that iterates over the elements in this list in proper sequence.

M

main(String[]) - Static method in class MyList
 
main(String[]) - Static method in class SnakesGame
The main method.
move(SnakesGame) - Method in class Snake
Move the snake one step.
movePlayers() - Method in class SnakesGame
For each player, consume the next command and move accordingly.
MyList<AnyType> - Class in <Unnamed>
A generic linked list class that you will write so that it implements the SimpleList<AnyType> and SimpleQueue<AnyType> interfaces.
MyList() - Constructor for class MyList
 

O

onPosition(Point) - Method in class Pellets
Determine whether a pellet lies on the given position.
onPosition(Point) - Method in class Snake
Determine whether any part of the snake's body lies on the given position.

P

paint(Graphics) - Method in class Pellets
Draw the pellets on the given pane
paint(Graphics) - Method in class Snake
Draw this snake on the given graphics pane and draw its score in the appropriate location.
paint(Graphics) - Method in class SnakesGame
Draw the current game state, or display splash screen with winner if done.
peek() - Method in class MyList
Retrieves, but does not rempve, the first element of the queue
peek() - Method in interface SimpleQueue
Retrieves, but does not remove, the first element of the queue
Pellets - Class in <Unnamed>
Pellets, to be eaten by a Snake in the Snakes Game.
Pellets(Color, int) - Constructor for class Pellets
Create the new pellets, with the given color at randomly chosen positions.

R

remove(AnyType) - Method in class MyList
Removes the first element of the list that is equal to value
remove(Point) - Method in class Pellets
Remove the pellet at Point p from the collection of pellets.
remove(AnyType) - Method in interface SimpleList
Removes the first element of the list that equals value.
run() - Method in class SnakesGame
Run the game and animate the results.

S

setDirection(char) - Method in class Snake
Set the direction of the head of the snake.
SimpleList<AnyType> - Interface in <Unnamed>
An interface for simple lists that includes an Iterator.
SimpleQueue<AnyType> - Interface in <Unnamed>
An interface for queues that includes an Iterator.
Snake - Class in <Unnamed>
Snake, for use in the Snakes Game
Snake(Color, Point, int, int) - Constructor for class Snake
Construct a new snake with the given color and starting position.
SnakesGame - Class in <Unnamed>
The user interface and main program for the Snakes game.
SnakesGame() - Constructor for class SnakesGame
Construct a new instance of the snake game.

T

toString() - Method in class MyList
Returns a string representation of this linked list
A C D E G I M O P R S T 
Skip navigation links