public class LevelAnalyzer
extends java.lang.Object
Constructor and Description |
---|
LevelAnalyzer(SLDescription description)
Constructor for the level analyzer where it analyze SLDescription object
|
Modifier and Type | Method and Description |
---|---|
int |
getArea()
get the level area
|
GameDescription.SpriteData[] |
getAvatars(boolean inMap)
Get avatar sprite data
|
GameDescription.SpriteData[] |
getBorderObjects(double lowThreshold,
double highThreshold)
get all border objects that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getBorderObjects(int lowThreshold,
int highThreshold)
get all border objects that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getImmovables(boolean inMap)
get all immovables that either in the map or not
|
GameDescription.SpriteData[] |
getImmovables(double lowThreshold,
double highThreshold)
get all immovables that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getImmovables(int lowThreshold,
int highThreshold)
get all immovables that are in between lowThreshold and highThreshold percentages
|
int |
getLength()
get the level length (y-axis)
|
GameDescription.SpriteData[] |
getMovables(boolean inMap)
get all movables that are either in the map or not
|
GameDescription.SpriteData[] |
getMovables(double lowThreshold,
double highThreshold)
get all movables that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getMovables(int lowThreshold,
int highThreshold)
get all movables that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getNPCs(boolean inMap)
get all npcs that either in map or not
|
GameDescription.SpriteData[] |
getNPCs(double lowThreshold,
double highThreshold)
get all npcs that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getNPCs(int lowThreshold,
int highThreshold)
get all npcs that are in between lowThreshold and highThreshold percentages
|
double |
getNumberOfObjects(java.lang.String spriteName)
get the number of times a certain sprite appear in the map
|
int |
getPerimeter()
get the level perimeter
|
GameDescription.SpriteData[] |
getPortals(boolean inMap)
get all portals that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getPortals(double lowThreshold,
double highThreshold)
get all portals that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getPortals(int lowThreshold,
int highThreshold)
get all portals that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getResources(boolean inMap)
get all resources that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getResources(double lowThreshold,
double highThreshold)
get all resources that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getResources(int lowThreshold,
int highThreshold)
get all resources that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getSpawners(boolean inMap)
get all spawners that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getSpawners(double lowThreshold,
double highThreshold)
get all spawners that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getSpawners(int lowThreshold,
int highThreshold)
get all spawners that are in between lowThreshold and highThreshold percentages
|
GameDescription.SpriteData[] |
getSpritesOnSameTile(java.lang.String spriteName)
get all the sprites that are on the same tile with a certain sprite
|
int |
getWidth()
get the level width (x-axis)
|
public LevelAnalyzer(SLDescription description)
description
- the current game & level descriptionpublic int getLength()
public int getWidth()
public int getArea()
public int getPerimeter()
public GameDescription.SpriteData[] getAvatars(boolean inMap)
inMap
- if he is defined in the map or notpublic GameDescription.SpriteData[] getNPCs(double lowThreshold, double highThreshold)
lowThreshold
- the lowest percentagehighThreshold
- the maximum percentagepublic GameDescription.SpriteData[] getNPCs(int lowThreshold, int highThreshold)
lowThreshold
- the lowest number of spriteshighThreshold
- the maximum number of spritespublic GameDescription.SpriteData[] getNPCs(boolean inMap)
inMap
- if npc is defined in the map or notpublic GameDescription.SpriteData[] getImmovables(double lowThreshold, double highThreshold)
lowThreshold
- the lowest percentagehighThreshold
- the maximum percentagepublic GameDescription.SpriteData[] getImmovables(int lowThreshold, int highThreshold)
lowThreshold
- the lowest numberhighThreshold
- the maximum numberpublic GameDescription.SpriteData[] getImmovables(boolean inMap)
inMap
- the sprite should be in the mappublic GameDescription.SpriteData[] getMovables(double lowThreshold, double highThreshold)
lowThreshold
- the lowest percentagehighThreshold
- the maximum percentagepublic GameDescription.SpriteData[] getMovables(int lowThreshold, int highThreshold)
lowThreshold
- the lowest numberhighThreshold
- the maximum numberpublic GameDescription.SpriteData[] getMovables(boolean inMap)
inMap
- the sprite should be in the mappublic GameDescription.SpriteData[] getPortals(double lowThreshold, double highThreshold)
lowThreshold
- the lowest percentagehighThreshold
- the maximum percentagepublic GameDescription.SpriteData[] getPortals(int lowThreshold, int highThreshold)
lowThreshold
- the lowest numberhighThreshold
- the maximum numberpublic GameDescription.SpriteData[] getPortals(boolean inMap)
inMap
- the sprite should be in the mappublic GameDescription.SpriteData[] getResources(double lowThreshold, double highThreshold)
lowThreshold
- the lowest percentagehighThreshold
- the maximum percentagepublic GameDescription.SpriteData[] getResources(int lowThreshold, int highThreshold)
lowThreshold
- the lowest numberhighThreshold
- the maximum numberpublic GameDescription.SpriteData[] getResources(boolean inMap)
inMap
- the sprite should be in the mappublic GameDescription.SpriteData[] getSpawners(double lowThreshold, double highThreshold)
lowThreshold
- the lowest percentagehighThreshold
- the maximum percentagepublic GameDescription.SpriteData[] getSpawners(int lowThreshold, int highThreshold)
lowThreshold
- the lowest numberhighThreshold
- the maximum numberpublic GameDescription.SpriteData[] getSpawners(boolean inMap)
inMap
- the sprite should be in the mappublic GameDescription.SpriteData[] getBorderObjects(double lowThreshold, double highThreshold)
lowThreshold
- the lowest percentagehighThreshold
- the maximum percentagepublic GameDescription.SpriteData[] getBorderObjects(int lowThreshold, int highThreshold)
lowThreshold
- the lowest numberhighThreshold
- the maximum numberpublic double getNumberOfObjects(java.lang.String spriteName)
spriteName
- the name of the spritepublic GameDescription.SpriteData[] getSpritesOnSameTile(java.lang.String spriteName)
spriteName
- the name of the sprite