cz.cuni.amis.pogamut.defcon.communication.worldview.modules.bitmap
Class BitmapMapSource

Package class diagram package BitmapMapSource
java.lang.Object
  extended by cz.cuni.amis.pogamut.defcon.communication.worldview.AbstractMapSource
      extended by cz.cuni.amis.pogamut.defcon.communication.worldview.modules.bitmap.BitmapMapSource
All Implemented Interfaces:
IFlagChecker

public class BitmapMapSource
extends AbstractMapSource

Map source using bitmaps from the Bitmaps/ directory to provide access to map features.

Author:
Radek 'Black_Hand' Pibil

Field Summary
 
Fields inherited from class cz.cuni.amis.pogamut.defcon.communication.worldview.AbstractMapSource
STEP
 
Constructor Summary
BitmapMapSource(BufferedImage[] territories, int[] ownTerritories, SortedMap<Integer,int[]> enemyIdsAndTerritories, BufferedImage sailable)
           
BitmapMapSource(BufferedImage[] territories, int[] ownTerritories, SortedMap<Integer,int[]> enemyIdsAndTerritories, BufferedImage sailable, Logger log)
           
 
Method Summary
 SortedMap<Integer,BufferedImage> getOwnTerritories()
           
 BufferedImage getTerritorry(int index)
           
 boolean hasEnemyTerritoryFlag(double x, double y, int enemyId)
          Returns true if the given location is a valid territory for the given teamId.
 boolean hasEnemyTerritoryFlag(double x, double y, int enemyId, boolean seaArea)
           
 boolean hasEnemyTerritoryFlag(Location location, int enemyId)
          Returns true if the given location is a valid territory for the given teamId.
 boolean hasEnemyTerritoryFlag(Location location, int enemyId, boolean seaArea)
          Returns true if the given location is a valid territory for the given teamId.
 boolean hasFlag(double x, double y, BasicFlag flag)
          Returns true if the flag is present on the given location.
 boolean hasFlag(Location location, BasicFlag flag)
          Returns true if the flag is present on the given location.
 void setTerritorry(int index, BufferedImage bitmap)
           
 
Methods inherited from class cz.cuni.amis.pogamut.defcon.communication.worldview.AbstractMapSource
traceFromTo, traceFromTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitmapMapSource

public BitmapMapSource(BufferedImage[] territories,
                       int[] ownTerritories,
                       SortedMap<Integer,int[]> enemyIdsAndTerritories,
                       BufferedImage sailable)

BitmapMapSource

public BitmapMapSource(BufferedImage[] territories,
                       int[] ownTerritories,
                       SortedMap<Integer,int[]> enemyIdsAndTerritories,
                       BufferedImage sailable,
                       Logger log)
Method Detail

setTerritorry

public void setTerritorry(int index,
                          BufferedImage bitmap)

getTerritorry

public BufferedImage getTerritorry(int index)

getOwnTerritories

public SortedMap<Integer,BufferedImage> getOwnTerritories()

hasFlag

public boolean hasFlag(double x,
                       double y,
                       BasicFlag flag)
Description copied from interface: IFlagChecker
Returns true if the flag is present on the given location. Uses cached values.

Returns:

hasFlag

public boolean hasFlag(Location location,
                       BasicFlag flag)
Description copied from interface: IFlagChecker
Returns true if the flag is present on the given location. Uses cached values.

Returns:

hasEnemyTerritoryFlag

public boolean hasEnemyTerritoryFlag(Location location,
                                     int enemyId)
Description copied from interface: IFlagChecker
Returns true if the given location is a valid territory for the given teamId.

Returns:

hasEnemyTerritoryFlag

public boolean hasEnemyTerritoryFlag(double x,
                                     double y,
                                     int enemyId)
Description copied from interface: IFlagChecker
Returns true if the given location is a valid territory for the given teamId.

Returns:

hasEnemyTerritoryFlag

public boolean hasEnemyTerritoryFlag(Location location,
                                     int enemyId,
                                     boolean seaArea)
Description copied from interface: IFlagChecker
Returns true if the given location is a valid territory for the given teamId.

seaArea - if true then checks, whether [x, y] is a sea territory
Returns:

hasEnemyTerritoryFlag

public boolean hasEnemyTerritoryFlag(double x,
                                     double y,
                                     int enemyId,
                                     boolean seaArea)


Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.