com.b3dgs.lionengine.game.map
Class Border20Map

java.lang.Object
  extended by com.b3dgs.lionengine.game.map.Border20Map

public class Border20Map
extends java.lang.Object

Represents a 20 Axis map, designed to perform linking between two differents areas. A good example is the fog of war, or a tree area inside a grass area. It supports until 20 links (verticals, horizontals, corners in/out, middle...). It has to be used with a tile based map.

See Also:
Border20

Constructor Summary
Border20Map(boolean middle)
          Create a Border20Map map.
 
Method Summary
 void checkAll(Border20[][] map, int tx, int ty, int tw, int th, int ray)
          Check all tiles arround the specified location using the specified ray (area).
 void create(TileBasedMap<?> map)
          Create the Border20Map map.
 void finalCheck(Border20[][] map, int y, int x)
          Usually called in case of matching error.
 Border20 get(Border20[][] map, int v, int h)
          Get axis value of the specified location.
 void set(Border20[][] map, int v, int h, Border20 axis)
          Set an axis value.
 void updateExclude(Border20[][] map, int tx, int ty)
          Special update routine for the outer area.
 void updateInclude(Border20[][] map, int tx, int ty, int tw, int th, int ray)
          Special update routine for the inner area.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Border20Map

public Border20Map(boolean middle)
Create a Border20Map map.

Parameters:
middle - middle flag.
Method Detail

create

public void create(TileBasedMap<?> map)
Create the Border20Map map.

Parameters:
map - map reference.

updateInclude

public void updateInclude(Border20[][] map,
                          int tx,
                          int ty,
                          int tw,
                          int th,
                          int ray)
Special update routine for the inner area. The inner area can be used when a tile recieve the CENTER value. The adjacents tiles will be updated in order to match with the outer area.

Parameters:
map - axis20 map reference (map which will contain axis data).
tx - tile x to check.
ty - tile y to check.
tw - width in tile to check.
th - height in tile to check.
ray - ray to check (in tile).

updateExclude

public void updateExclude(Border20[][] map,
                          int tx,
                          int ty)
Special update routine for the outer area. The outer area can be used when a tile receive the NONE value. The adjacents tiles will be updated in order to match with the outer area.

Parameters:
map - axis20 map reference (map which will contain axis data).
tx - tile x to check.
ty - tile y to check.

checkAll

public void checkAll(Border20[][] map,
                     int tx,
                     int ty,
                     int tw,
                     int th,
                     int ray)
Check all tiles arround the specified location using the specified ray (area). All ajdacent tiles will be adjusted in order to make match two linked areas.

Parameters:
map - axis20 map reference (map which will contain axis data).
tx - tile x to check.
ty - tile y to check.
tw - width in tile to check.
th - height in tile to check.
ray - ray to check (in tile).

finalCheck

public void finalCheck(Border20[][] map,
                       int y,
                       int x)
Usually called in case of matching error. This function will perform some last checks.

Parameters:
map - axis20 map reference (map which will contain axis data).
x - tile x to check.
y - tile y to check.

set

public void set(Border20[][] map,
                int v,
                int h,
                Border20 axis)
Set an axis value.

Parameters:
map - map reference.
v - vertical tile.
h - horizontal tile.
axis - axis value.

get

public Border20 get(Border20[][] map,
                    int v,
                    int h)
Get axis value of the specified location.

Parameters:
map - map reference.
v - vertical tile.
h - horizontal tile.
Returns:
axis value.