Skip to content

Level Analyzer Class

Ahmed Abdel Samea Khalifa edited this page Mar 28, 2017 · 1 revision

LevelAnalyzer class is a helper class used in the constructive level generator to help in generating the new game. This class provides multiple functions that helps in analyzing the sprites and the current level. These functions are divided into two main categories:

Numerical Information

LevelAnalyzer functions Description
int getLength() Return the length of the level.
int getWidth() Return the width of the level.
int getArea() Return the area of the level.
int getPerimeter() Return the perimeter of the level
double getNumberOfObjects(String spriteName) Return the number of sprites with spriteName in the current level.

Sprite Information

LevelAnalyzer functions Description
SpriteData[] getAvatars(boolean inMap) Return a list of avatar sprites that exist on the map or all of them.
SpriteData[] getNPCs(double lowThreshold, double highThreshold) Return a list of NPC sprites that covers a percentage between lowThreshold and highThreshold.
SpriteData[] getNPCs(int lowThreshold, int highThreshold) Return a list of NPC sprites that have a number between lowThreshold and highThreshold.
SpriteData[] getNPCs(boolean inMap) Return a list of NPC sprites that exist on the map or all of them.
SpriteData[] getImmovables(double lowThreshold, double highThreshold) Return a list of immovable sprites that covers a percentage between lowThreshold and highThreshold.
SpriteData[] getImmovables(int lowThreshold, int highThreshold) Return a list of immovable sprites that have a number between lowThreshold and highThreshold.
SpriteData[] getImmovables(boolean inMap) Return a list of immovable sprites that exist on the map or all of them.
SpriteData[] getMovables(double lowThreshold, double highThreshold) Return a list of movable sprites that covers a percentage between lowThreshold and highThreshold.
SpriteData[] getMovables(int lowThreshold, int highThreshold) Return a list of movable sprites that have a number between lowThreshold and highThreshold.
SpriteData[] getMovables(boolean inMap) Return a list of movable sprites that exist on the map or all of them.
SpriteData[] getPortals(double lowThreshold, double highThreshold) Return a list of portal sprites that covers a percentage between lowThreshold and highThreshold.
SpriteData[] getPortals(int lowThreshold, int highThreshold) Return a list of portal sprites that have a number between lowThreshold and highThreshold.
SpriteData[] getPortals(boolean inMap) Return a list of portal sprites that exist on the map or all of them.
SpriteData[] getResources(double lowThreshold, double highThreshold) Return a list of resource sprites that covers a percentage between lowThreshold and highThreshold.
SpriteData[] getResources(int lowThreshold, int highThreshold) Return a list of resource sprites that have a number between lowThreshold and highThreshold.
SpriteData[] getResources(boolean inMap) Return a list of resource sprites that exist on the map or all of them.
SpriteData[] getSpawners(double lowThreshold, double highThreshold) Return a list of spawner sprites that covers a percentage between lowThreshold and highThreshold.
SpriteData[] getSpawners(int lowThreshold, int highThreshold) Return a list of spawner sprites that have a number between lowThreshold and highThreshold.
SpriteData[] getSpawners(boolean inMap) Return a list of spawner sprites that exist on the map or all of them.
SpriteData[] getBorderObjects(double lowThreshold, double highThreshold) Return a list of sprites that lies on the border of the level and covers a percentage between lowThreshold and highThreshold.
SpriteData[] getBorderObjects(int lowThreshold, int highThreshold) Return a list of sprites that lies on the border of the level and have a number of sprites between lowThreshold and highThreshold.
SpriteData[] getSpritesOnSameTile(String spriteName) Return a list of all sprites that share the same location on the map as spriteName sprite.

Table of Contents:

Clone this wiki locally