morey.spore
Class ProximityList

java.lang.Object
  |
  +--morey.spore.ProximityList

public class ProximityList
extends java.lang.Object

A ProximityList holds lists of spores or claims that are near each other. ** Also used to enforce the border!!!! With later versions, this class will be gutted and replace by something with better time and space properties.

Here is a link to the source code

See Also:
Link

Field Summary
protected  java.util.Vector[][] chart
          the table of all the spore neighbourhoods.
protected static double DIST
          a constant that describes the size of each mini-section used optimizes the number of checks per change to the List (will be figured out later)
protected  double H
          the dimension of the board
protected  double W
          the dimension of the board
protected  int xN
          the chart dimensions
protected  int yN
          the chart dimensions
 
Constructor Summary
ProximityList(double x, double y)
          simple constructor for a ProximityList.
 
Method Summary
 void addLink(Link l)
          add the l into every effected part of the chart this will run into problems if the polygon is big compared to the space
 java.util.Enumeration checkLink(Link l)
          This is ugly....
static void main(java.lang.String[] args)
          some tests of ProximityList
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DIST

protected static final double DIST
a constant that describes the size of each mini-section used optimizes the number of checks per change to the List (will be figured out later)

chart

protected java.util.Vector[][] chart
the table of all the spore neighbourhoods. Breaking down the board into neighbourhoods saves time in collision checking. Movement really only has local effects.

H

protected double H
the dimension of the board

W

protected double W
the dimension of the board

xN

protected int xN
the chart dimensions

yN

protected int yN
the chart dimensions
Constructor Detail

ProximityList

public ProximityList(double x,
                     double y)
simple constructor for a ProximityList. Approximate below refers to the rounding that occurs because of squares of length DIST
Parameters:
x - - the approximate width of the space for the spores to reside
y - - the approximate height of the space for the spores to reside
Method Detail

addLink

public void addLink(Link l)
add the l into every effected part of the chart this will run into problems if the polygon is big compared to the space
Parameters:
l - - the link to be added to the charts

checkLink

public java.util.Enumeration checkLink(Link l)
This is ugly.... The enumeration should be empty if the Link has no collisions otherwise both an enumeration of the Links and wall are returned.
Parameters:
l - - the link to be check against the charts

toString

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

main

public static void main(java.lang.String[] args)
some tests of ProximityList