edu.lmu.liftor
Interface Person.Personality

All Known Implementing Classes:
Traveller
Enclosing interface:
Person

public static interface Person.Personality

A personality is used to control the behavior of a person. The personality directs the person to navigate and interact with their surroundings.


Method Summary
 java.lang.String getName()
          Returns the name of this personality.
 int motivate(Person p)
          Motivate this person.
 

Method Detail

motivate

public int motivate(Person p)
Motivate this person. This method is repeatedly called so long as this is the given Person's dominant personality. In essence, it should decide upon a goal, execute that goal, then return so that it may be called again to repeat the goal selection and execution process. A personality may take as little or as long as it wants to complete its objective, it may even decide to store state and return knowing it will (most likely) be called again. The number that is returned is the number of milliseconds that the Personality is willing to wait for another chance to execute. While there is no guarantee that motivate() will be called again within that time, it allows the use of a thread pool to move persons around in the game. If the quantity returned is negative, that is the maximum amount of time that the Personality would like to have elapse before the next call. If it is a postive number, that is the minimum amount of time and the Personality is willing to allow more time to elapse if necessary.


getName

public java.lang.String getName()
Returns the name of this personality. Preferably an adverb.