DE.purple_sunshine.bigbro
Class Person

java.lang.Object
  |
  +--DE.purple_sunshine.bigbro.Person

public class Person
extends java.lang.Object

A Person represents a real person in the bb-house. It can compute a new position according to a certain time.

Since:
JDK1.1
Version:
1.0
Author:
Holger Wagner

Field Summary
 boolean fadeIn
           
 
Constructor Summary
Person(java.lang.String id, java.awt.Color color, House house)
          Constructs a new Person.
 
Method Summary
 void computePosition(double frac)
          Computs the current position of this person within its current path.
 java.awt.Color getColor()
           
 java.lang.String getId()
          Returns the id of this person.
 java.awt.Point getPosition()
          Returns the current position of this person.
 void moveTo(PathArea target)
          Gives the person a new target to move to.
 void moveTo(PathElement target)
          Gives the person a new target to move to.
 void moveTo(java.lang.String target)
          Gives the person a new target to move to.
 void moveToRandom()
          Makes the person move to a random PathArea.
 void paintInto(java.awt.Graphics g)
          Paints this person at its current position into g
 void resetTime()
          Switches the current path to the next path and resets pathStep.
 void setColor(java.awt.Color color)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fadeIn

public boolean fadeIn
Constructor Detail

Person

public Person(java.lang.String id,
              java.awt.Color color,
              House house)
Constructs a new Person.
Parameters:
id - the unique ID of this person
color - the color in which this person shall be painted
house - the house within which this person moves around
Method Detail

computePosition

public void computePosition(double frac)
Computs the current position of this person within its current path.
Parameters:
frac - a value between 0.0 and 1.0 that indicates how much time has passed since the last position update, and how much time is still left

getPosition

public java.awt.Point getPosition()
Returns the current position of this person.
Returns:
the current position of this person

getId

public java.lang.String getId()
Returns the id of this person.
Returns:
the id of this person

paintInto

public void paintInto(java.awt.Graphics g)
Paints this person at its current position into g
Parameters:
g - the Graphics instance to paint into

getColor

public java.awt.Color getColor()

setColor

public void setColor(java.awt.Color color)

moveTo

public void moveTo(java.lang.String target)
Gives the person a new target to move to.
Parameters:
target - the target as a String

moveTo

public void moveTo(PathElement target)
Gives the person a new target to move to.
Parameters:
target - the target as a PathElement

moveTo

public void moveTo(PathArea target)
Gives the person a new target to move to.
Parameters:
target - the target as a PathElement

moveToRandom

public void moveToRandom()
Makes the person move to a random PathArea.
See Also:
House.getRandomPathArea()

resetTime

public void resetTime()
Switches the current path to the next path and resets pathStep.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


© 2000, Holger Wagner, Purple Sunshine Productions.