Actually, you can just add a single dimensional array as a property within the "location" class which holds 10 integers, each one corresponding to a particular direction. For example, the array could be:
{N,E,W,S,NE,NW,SE,SW,Up,Down}
For a particular room, the array might read:
{1,0,0,1,0,0,0,0,1,0} which means that he can move north, south and up, but not anywhere else.
__________________
Credits to Loveless for the great signature!
We rode on the winds of the rising storm
We ran to the sounds of thunder
We danced among the lightning bolts
And tore the world asunder
|