map
Class MapItemList

java.lang.Object
  extended by java.util.Vector
      extended by map.MapItemList

public class MapItemList
extends java.util.Vector

A Map ItemList is a collection of MapItems. A Map ItemList is generated by assigning each MapPoint to a Unit from the Grid. From that Units a predefined collection of Map Items per Unit is taken and added to the MapItemList.
In Figure "MAP Grid" Map Point 1 is mapped to Unit (0,3). From that Unit one or more Map Items are taken and added to the Map ItemList. The procedure is repeated through all Map Points (=Path).

See build(java.util.Vector, map.Grid, boolean, int) for more details


Author:
Peter Hlavac
See Also:
MapItem, MapPoint, Grid, Unit

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Constructor Summary
MapItemList(java.lang.String name)
           
 
Method Summary
 void build(java.util.Vector mapPoints, Grid grid, boolean bRandomize, int maxNumberOfMapItems)
          Builds a MapItemList from the path, that was drawn by the user.
 
Methods inherited from class java.util.Vector
addElement, capacity, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, removeAllElements, removeElement, removeElementAt, setElementAt, setSize, size, toString, trimToSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapItemList

public MapItemList(java.lang.String name)
Method Detail

build

public void build(java.util.Vector mapPoints,
                  Grid grid,
                  boolean bRandomize,
                  int maxNumberOfMapItems)
Builds a MapItemList from the path, that was drawn by the user. The path consists of Map Points. Every Map Point belongs to a Unit. From that Units Map Items are taken and added to the MapItemList. Map Items are choosen from a Unit either randomly or in a ordered manner from the first to the last item.
An example: build is called with bRandomize set to false and maxNumberOfMapItems set to 3. For a Map Point placed in Unit X the first 3 Map Items of that Unit are added to the MapItemList.
The MapItemList never contains any Map Item twice.

Parameters:
mapPoints - the list of Map Points
grid - the Grid containing Map Items
bRandomize - if set to true Map Items from a Unit are selected randomly.
maxNumberOfMapItems - the maximum number of Map Items taken from a Unit