Wednesday, May 16, 2012

Lets get Linked!

My experience with the linked list is a mixed one. On one hand I was able to construct the rest of a Singly linked list, but on the other hand, the Doubly link list is not going so well. In general the idea of a linked list very logical and seems that it could be easily implemented into my program. But where to put it and how? Those are the questions that everyone is asking. From the completely random and anonymous survey taken by the imaginary test group of Graduate Teaching Fellows (GTFs) at the University of Oregon (UO), it was selected to use a linked list to control where a player will go to next. The idea that will be behind this operation will be as follows:
  1. All towns will be added to this list.
  2. When a player is trying to decide where to go, they will refer to this list
  3. At each next location, the player will call the getState function of the town to get ownership.
  4. If the state is not of a certain function the player will set out for that location
  5. If the state is of the certain state, the player will call the next item in the list.
One idea I am playing will is maybe getting a distance between the player and the states and will cause the player to move to the closed state to take over. 

On the idea of iterators, I like the idea. I'm a fan of 'if then else' and loops. So I think this concept will be simple to implement once I figure out how my players will interact with them.

No comments:

Post a Comment