本文整理汇总了Java中org.andengine.util.debug.Debug.e方法的典型用法代码示例。如果您正苦于以下问题:Java Debug.e方法的具体用法?Java Debug.e怎么用?Java Debug.e使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.andengine.util.debug.Debug
的用法示例。
在下文中一共展示了Debug.e方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: scan
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
/**
* Identify available locales
* @param locales_directory
* @return
*/
public Map<String, String> scan(String locales_directory) throws IOException {
final Map<String, String> locale_map = new HashMap<String, String>();
String[] files = PhoeniciaContext.assetManager.list(locales_directory);
for (String locale_dir: files) {
if (locale_dir.equals("common")) continue;
String locale_path = locales_directory+"/"+locale_dir+"/manifest.xml";
LocaleHeaderScanner scanner = new LocaleHeaderScanner(locale_path, locale_map);
try {
InputStream locale_manifest_in = PhoeniciaContext.assetManager.open(locale_path);
final SAXParserFactory spf = SAXParserFactory.newInstance();
final SAXParser sp = spf.newSAXParser();
final XMLReader xr = sp.getXMLReader();
xr.setContentHandler(scanner);
xr.parse(new InputSource(new BufferedInputStream(locale_manifest_in)));
} catch (Exception e) {
Debug.e(e);
}
}
return locale_map;
}
示例2: load
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
/**
* Load and read the manifest.xml for a Locale.
* @param locale_manifest_in
* @return
*/
public Locale load(InputStream locale_manifest_in) {
LocaleParser localeParser = new LocaleParser();
try {
final SAXParserFactory spf = SAXParserFactory.newInstance();
final SAXParser sp = spf.newSAXParser();
final XMLReader xr = sp.getXMLReader();
xr.setContentHandler(localeParser);
xr.parse(new InputSource(new BufferedInputStream(locale_manifest_in)));
} catch (Exception e) {
Debug.e(e);
}
return localeParser.getLocale();
}
示例3: onInventoryUpdated
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
/**
* Handle changes in the player's inventory by resetting the counter under each letter
* @param items The items which have changed
*/
public void onInventoryUpdated(final InventoryItem[] items) {
Debug.d("Updating WorkshopHUD inventory");
for (int i = 0; i < items.length; i++) {
Debug.d("Updating WorkshopHUD count for "+items[i].item_name.get());
if (this.inventoryCounts.containsKey(items[i].item_name.get())) {
Debug.d("New HUD count: "+items[i].quantity.get().toString());
final Text countText = this.inventoryCounts.get(items[i].item_name.get());
final int newCount =(items[i].quantity.get()-this.usedCounts.get(items[i].item_name.get()));
countText.setText(""+newCount);
//countText.setText("9");
} else {
Debug.e("[Workshop] No HUD item for "+items[i].item_name.get());
}
}
}
示例4: onInventoryUpdated
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
/**
* Handle changes in the player's inventory by resetting the counter under each letter
* @param items The items which have changed
*/
public void onInventoryUpdated(final InventoryItem[] items) {
Debug.d("Updating WordBuilderHUD inventory");
for (int i = 0; i < items.length; i++) {
Debug.d("Updating WordBuilderHUD count for "+items[i].item_name.get());
if (this.inventoryCounts.containsKey(items[i].item_name.get())) {
Debug.d("New HUD count: "+items[i].quantity.get().toString());
final Text countText = this.inventoryCounts.get(items[i].item_name.get());
final int newCount =(items[i].quantity.get()-this.usedCounts.get(items[i].item_name.get()));
countText.setText(""+newCount);
//countText.setText("9");
} else {
Debug.e("[WordBuilderHUD] No HUD item for "+items[i].item_name.get());
}
}
}
示例5: reset
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
/**
* Restart the build progress for this tile
* @param context ApplicationContext ApplicationContext for use in database calls
*/
public void reset(Context context) {
if (this.sprite != null) {
this.sprite.setProgress(0, letter.time);
}
LetterBuilder builder = this.getBuilder(context);
if (builder != null) {
//Debug.d("Resetting LetterTile builder");
builder.progress.set(0);
builder.start();
builder.save(context);
this.phoeniciaGame.addBuilder(builder);
} else {
Debug.e("Could not reset LetterTile builder, because it was missing");
}
}
示例6: reset
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
/**
* Restart the build progress for this tile
* @param context ApplicationContext ApplicationContext for use in database calls
*/
public void reset(Context context) {
if (this.sprite != null) {
this.sprite.setProgress(0, word.construct);
}
WordTileBuilder builder = this.getBuilder(context);
if (builder != null) {
Debug.d("Resetting WordTile builder");
builder.progress.set(0);
builder.start();
builder.save(context);
this.phoeniciaGame.addBuilder(builder);
} else {
Debug.e("Could not reset WordTile builder, because it was missing");
}
}
示例7: fulfillRequest
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
/**
* Mark a given request as having been fulfilled, and at the same time subtract the requested
* items from the player's inventory, and credit the player for the coins and experience points
* offered in the request
* @param request
*/
public void fulfillRequest(MarketRequest request) {
Debug.d("Completing sale to " + request.person_name.get());
for (RequestItem item : request.getItems(PhoeniciaContext.context)) {
try {
Inventory.getInstance().subtract(item.item_name.get(), item.quantity.get());
} catch (Exception e) {
Debug.e("Failed to subtract inventory item "+item.item_name.get()+" while completing sale");
return;
}
}
Bank.getInstance().credit(request.coins.get());
this.game.session.addExperience(request.points.get());
request.status.set(MarketRequest.FULFILLED);
request.save(PhoeniciaContext.context);
this.requestFulfilled(request);
}
示例8: onClick
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
/**
* Called when the Sprite for the tile has been clicked by the player
* @param buttonSprite
* @param v
* @param v2
*/
public void onClick(MapBlockSprite buttonSprite, float v, float v2) {
if (this.item_type.get().equals("inventory")) {
if (phoeniciaGame.locale.isLevelReached(phoeniciaGame.locale.inventoryBlock.level, phoeniciaGame.getCurrentLevel())) {
phoeniciaGame.hudManager.showInventory();
} else {
this.showLevelLock(phoeniciaGame.locale.inventoryBlock.level);
}
} else if (this.item_type.get().equals("market")) {
if (phoeniciaGame.locale.isLevelReached(phoeniciaGame.locale.marketBlock.level, phoeniciaGame.getCurrentLevel())) {
phoeniciaGame.hudManager.showMarket();
} else {
this.showLevelLock(phoeniciaGame.locale.marketBlock.level);
}
} else if (this.item_type.get().equals("workshop")) {
if (phoeniciaGame.locale.isLevelReached(phoeniciaGame.locale.workshopBlock.level, phoeniciaGame.getCurrentLevel())) {
phoeniciaGame.hudManager.showWorkshop(this);
} else {
this.showLevelLock(phoeniciaGame.locale.workshopBlock.level);
}
} else {
Debug.e("Unknown default block: "+this.item_type.get());
}
}
示例9: createWord
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
protected void createWord() {
Debug.d("Preparing to build word: " + tile.word.name);
try {
for (int i = 0; i < spelling.length; i++) {
final String letter = new String(spelling, i, 1);
usedCounts.put(letter, usedCounts.get(letter)-1);
Inventory.getInstance().subtract(letter);
}
Debug.d("Creating new WordBuilder for " + tile.word.name);
WordBuilder builder = tile.createWord();
this.addWordToQueue(builder, true);
GameSounds.play(GameSounds.COMPLETE);
} catch (Exception e) {
Debug.e("Error subtracting letter: "+e.getMessage());
e.printStackTrace();
}
}
示例10: setSpotlight
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
public void setSpotlight(String texture) {
try {
final AssetBitmapTexture spotlight_texture = new AssetBitmapTexture(PhoeniciaContext.textureManager, PhoeniciaContext.assetManager, texture);
spotlight_texture.load();
TextureRegion spotlight_region = TextureRegionFactory.extractFromTexture(spotlight_texture);
this.clearSpotlight();
this.spotlight = new Sprite(this.getWidth()/2, this.getHeight()/2, spotlight_region, PhoeniciaContext.vboManager);
this.spotlight.setZIndex(this.guideSprite.getZIndex()-1);
this.attachChild(this.spotlight);
this.sortChildren();
} catch (IOException e) {
Debug.e("Failed to load spotlight texture: "+texture);
}
}
示例11: parseMarket
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
private void parseMarket(Attributes attributes) throws SAXException {
Debug.v("Parsing locale market");
this.locale.marketBlock = new MarketBlock();
this.locale.marketBlock.name = attributes.getValue("name");
this.locale.marketBlock.level = attributes.getValue("level");
this.locale.marketBlock.gifts_after = Integer.parseInt(attributes.getValue("gifts_after"));
String size = attributes.getValue("size");
if (size == null || size == "" || size == "1x1" || size == "1x1x1") {
this.locale.marketBlock.columns = 1;
this.locale.marketBlock.rows = 1;
this.locale.marketBlock.height = 1;
} else {
try {
String[] dimensions = size.split("x");
this.locale.marketBlock.columns = Integer.parseInt(dimensions[0]);
this.locale.marketBlock.rows = Integer.parseInt(dimensions[1]);
if (dimensions.length > 2) {
this.locale.marketBlock.height = Integer.parseInt(dimensions[2]);
} else {
this.locale.marketBlock.height = 1;
}
} catch (Exception e) {
Debug.e("Failed to parse size for: "+this.locale.marketBlock.name);
e.printStackTrace();
}
}
this.locale.marketBlock.block_texture = attributes.getValue("block");
this.locale.marketBlock.mapCol = Integer.parseInt(attributes.getValue("col"));
this.locale.marketBlock.mapRow = Integer.parseInt(attributes.getValue("row"));
}
示例12: parseGame
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
private void parseGame(Attributes attributes) throws SAXException {
Debug.v("Parsing locale game");
Game newGame = new Game();
newGame.name = attributes.getValue("name");
newGame.level = attributes.getValue("level");
String size = attributes.getValue("size");
if (size == null || size == "" || size == "1x1" || size == "1x1x1") {
newGame.columns = 1;
newGame.rows = 1;
newGame.height = 1;
} else {
try {
String[] dimensions = size.split("x");
newGame.columns = Integer.parseInt(dimensions[0]);
newGame.rows = Integer.parseInt(dimensions[1]);
if (dimensions.length > 2) {
newGame.height = Integer.parseInt(dimensions[2]);
} else {
newGame.height = 1;
}
} catch (Exception e) {
Debug.e("Failed to parse size for: "+newGame.name);
e.printStackTrace();
}
}
newGame.restriction = attributes.getValue("restrict");
newGame.type = attributes.getValue("type");
newGame.sprite_texture = attributes.getValue("sprite");
newGame.block_texture = attributes.getValue("block");
newGame.background_texture = attributes.getValue("background");
newGame.host = this.locale.person_map.get(attributes.getValue("host"));
newGame.buy = Integer.parseInt(attributes.getValue("buy"));
newGame.construct = Integer.parseInt(attributes.getValue("construct"));
newGame.time = Integer.parseInt(attributes.getValue("time"));
newGame.reward = Float.parseFloat(attributes.getValue("reward"));
this.locale.games.add(newGame);
this.locale.game_map.put(newGame.name, newGame);
}
示例13: parseDecoration
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
private void parseDecoration(Attributes attributes) throws SAXException {
Debug.v("Parsing locale decoration");
Decoration newDecoration = new Decoration();
newDecoration.name = attributes.getValue("name");
newDecoration.level = attributes.getValue("level");
String size = attributes.getValue("size");
if (size == null || size == "" || size == "1x1" || size == "1x1x1") {
newDecoration.columns = 1;
newDecoration.rows = 1;
newDecoration.height = 1;
} else {
try {
String[] dimensions = size.split("x");
newDecoration.columns = Integer.parseInt(dimensions[0]);
newDecoration.rows = Integer.parseInt(dimensions[1]);
if (dimensions.length > 2) {
newDecoration.height = Integer.parseInt(dimensions[2]);
} else {
newDecoration.height = 1;
}
} catch (Exception e) {
Debug.e("Failed to parse size for: "+newDecoration.name);
e.printStackTrace();
}
}
newDecoration.restriction = attributes.getValue("restrict");
newDecoration.sprite_texture = attributes.getValue("sprite");
newDecoration.block_texture = attributes.getValue("block");
newDecoration.buy = Integer.parseInt(attributes.getValue("buy"));
this.locale.decorations.add(newDecoration);
this.locale.decoration_map.put(newDecoration.name, newDecoration);
}
示例14: parseLetterDefinition
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
private void parseLetterDefinition(Attributes attributes) throws SAXException {
Debug.v("Parsing locale letter");
this.currentLetter = new Letter();
this.currentLetter.name = attributes.getValue("name");
Debug.v("Parsing locale letter: "+this.currentLetter.name);
String size = attributes.getValue("size");
if (size == null || size == "" || size == "1x1" || size == "1x1x1") {
this.currentLetter.columns = 1;
this.currentLetter.rows = 1;
this.currentLetter.height = 1;
} else {
try {
String[] dimensions = size.split("x");
this.currentLetter.columns = Integer.parseInt(dimensions[0]);
this.currentLetter.rows = Integer.parseInt(dimensions[1]);
if (dimensions.length > 2) {
this.currentLetter.height = Integer.parseInt(dimensions[2]);
} else {
this.currentLetter.height = 1;
}
} catch (Exception e) {
Debug.e("Failed to parse letter size for: "+this.currentLetter.name);
e.printStackTrace();
}
}
this.currentLetter.restriction = attributes.getValue("restrict");
this.currentLetter.sound = attributes.getValue("sound");
this.currentLetter.phoneme = attributes.getValue("phoneme");
this.currentLetter.time = Integer.parseInt(attributes.getValue("time"));
this.currentLetter.buy = Integer.parseInt(attributes.getValue("buy"));
this.currentLetter.sell = Integer.parseInt(attributes.getValue("sell"));
this.currentLetter.points = Integer.parseInt(attributes.getValue("points"));
this.currentLetter.sprite_texture = attributes.getValue("sprite");
this.currentLetter.block_texture = attributes.getValue("block");
}
示例15: loadLocale
import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
private void loadLocale(ProgressDisplay progress) throws IOException {
// Initialize game shell textures
Texture newShell = new AssetBitmapTexture(PhoeniciaContext.textureManager, PhoeniciaContext.assetManager, this.locale.shell_src);
newShell.load();
GameUI.init(newShell);
// For storing sound data
blockSounds = new HashMap<String, Sound>();
// Load background music
try {
this.music = MusicFactory.createMusicFromAsset(PhoeniciaContext.musicManager, PhoeniciaContext.context, locale.music_src);
this.music.setLooping(true);
this.music.setVolume(0.3f);
} catch (Exception e) {
Debug.e("Failed to load background music asset: "+locale.music_src);
}
progress.setProgress(0.3f);
this.loadLocaleMap();
progress.setProgress(0.4f);
this.loadLocaleDefaults();
this.loadLocalePeople();
progress.setProgress(0.5f);
this.loadLocaleTour();
progress.setProgress(0.6f);
this.loadLocaleNumbers();
progress.setProgress(0.65f);
this.loadLocaleLetters();
progress.setProgress(0.7f);
this.loadLocaleWords();
progress.setProgress(0.8f);
this.loadLocaleGames();
progress.setProgress(0.9f);
this.loadLocaleDecorations();
this.loadLocaleLevels();
progress.setProgress(0.99f);
}