game

Class AbstractPlayer

Implemented Interfaces:
Transport
Known Direct Subclasses:
Detective, Fugitive

public abstract class AbstractPlayer
extends java.lang.Object
implements Transport

Abstract class AbstractPlayer - Defines the properties of player

Field Summary

protected Node
position
protected LinkedList
prevPositions

Fields inherited from interface game.Transport

BLACK, BUS, FERRY, INF, NONE, TAXI, UG

Method Summary

void
change(Node n)
This method changes the position of the Fugitive without adding it to the prevPositions array.
Node
getPosition()
This method gives the position of this player
LinkedList
getPrevPos()
This method returns the previous positions of the player

Field Details

position

protected Node position

prevPositions

protected LinkedList prevPositions

Method Details

change

public void change(Node n)
This method changes the position of the Fugitive without adding it to the prevPositions array.
Parameters:
n - the new node position of the detective

getPosition

public Node getPosition()
This method gives the position of this player
Returns:
the position of the player

getPrevPos

public LinkedList getPrevPos()
This method returns the previous positions of the player
Returns:
the array of the previous node positions of the player