rlgamekit.fieldofview
Class FieldOfView

java.lang.Object
  extended by rlgamekit.fieldofview.FieldOfView

public class FieldOfView
extends java.lang.Object

Generic field of view calculator. Uses fov_source_t and fov_destination_t objects to communicate with the application.


Constructor Summary
FieldOfView(FovSource source, FovDestination destination)
          Create a new field of view calculator.
 
Method Summary
 void calculate(int centerX, int centerY, int distance)
          Calculate field of view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldOfView

public FieldOfView(FovSource source,
                   FovDestination destination)
Create a new field of view calculator.

Parameters:
source - Used to check if a map cell blocks the line of sight
destination - Used to write the results of the visibility calculation
Method Detail

calculate

public void calculate(int centerX,
                      int centerY,
                      int distance)
Calculate field of view.

Parameters:
centerX - X origin (center) of field of view
centerY - Y origin (center) of field of view
distance - the max viewing distance