mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-01-18 09:34:04 +01:00
Refactor: Reduce warnings / reduce scope
This commit is contained in:
@@ -49,7 +49,7 @@ public final class ConversationActivity
|
||||
|
||||
private WorldContext world;
|
||||
private Player player;
|
||||
private ArrayList<ConversationStatement> conversationHistory = new ArrayList<ConversationStatement>();
|
||||
private final ArrayList<ConversationStatement> conversationHistory = new ArrayList<ConversationStatement>();
|
||||
private ConversationController.ConversationStatemachine conversationState;
|
||||
|
||||
private StatementContainerAdapter listAdapter;
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.gpl.rpg.AndorsTrail.savegames.Savegames.FileHeader;
|
||||
|
||||
public final class StartScreenActivity extends Activity {
|
||||
|
||||
public static final int INTENTREQUEST_PREFERENCES = 7;
|
||||
private static final int INTENTREQUEST_PREFERENCES = 7;
|
||||
public static final int INTENTREQUEST_LOADGAME = 9;
|
||||
|
||||
private boolean hasExistingGame = false;
|
||||
|
||||
@@ -283,7 +283,7 @@ public final class ConversationController {
|
||||
private String phraseID;
|
||||
private Phrase currentPhrase;
|
||||
private Monster npc;
|
||||
public ConversationStateListener listener;
|
||||
public final ConversationStateListener listener;
|
||||
|
||||
public ConversationStatemachine(WorldContext world, ControllerContext controllers, ConversationStateListener listener) {
|
||||
this.world = world;
|
||||
|
||||
@@ -11,7 +11,6 @@ public class PathFinder {
|
||||
private final boolean visited[];
|
||||
private final ListOfCoords visitQueue;
|
||||
private final EvaluateWalkable map;
|
||||
public int iterations = 0;
|
||||
|
||||
public PathFinder(int maxWidth, int maxHeight, EvaluateWalkable map) {
|
||||
this.maxWidth = maxWidth;
|
||||
@@ -26,7 +25,7 @@ public class PathFinder {
|
||||
}
|
||||
|
||||
public boolean findPathBetween(final CoordRect from, final Coord to, CoordRect nextStep) {
|
||||
iterations = 0;
|
||||
int iterations = 0;
|
||||
if (from.equals(to)) return false;
|
||||
|
||||
Coord measureDistanceTo = from.topLeft;
|
||||
|
||||
@@ -26,7 +26,7 @@ public final class MapObject {
|
||||
public final String id; //placeName on this map or phraseID
|
||||
public final String map;
|
||||
public final String place;
|
||||
public final String group;
|
||||
private final String group;
|
||||
public final Requirement enteringRequirement;
|
||||
public final DropList dropList;
|
||||
public final MapObjectEvaluationType evaluateWhen;
|
||||
|
||||
@@ -21,7 +21,7 @@ public final class MonsterSpawnArea {
|
||||
public final String[] monsterTypeIDs;
|
||||
public final ArrayList<Monster> monsters = new ArrayList<Monster>();
|
||||
public final boolean isUnique; // unique == non-respawnable
|
||||
public final String group;
|
||||
private final String group;
|
||||
public boolean isSpawning;
|
||||
public final boolean isSpawningForNewGame;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ public final class ReplaceableMapSection {
|
||||
public final CoordRect replacementArea;
|
||||
public final MapSection replaceLayersWith;
|
||||
public final QuestProgress requireQuestStage;
|
||||
public final String group;
|
||||
private final String group;
|
||||
|
||||
public ReplaceableMapSection(
|
||||
CoordRect replacementArea
|
||||
|
||||
@@ -19,6 +19,11 @@ public abstract class JsonArrayParserFor<T> extends JsonParserFor<T> {
|
||||
final ArrayList<T> arrayList = new ArrayList<T>(array.length());
|
||||
parseRows(array, arrayList);
|
||||
if (arrayList.isEmpty()) return null;
|
||||
return arrayList.toArray((T[]) Array.newInstance(classType, arrayList.size()));
|
||||
return arrayList.toArray(newArray(arrayList.size()));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private T[] newArray(int size) {
|
||||
return (T[]) Array.newInstance(classType, size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,10 +163,6 @@ public final class TileManager {
|
||||
public void setImageViewTile(ImageView imageView, ActorConditionType conditionType) { imageView.setImageBitmap(preloadedTiles.getBitmap(conditionType.iconID)); }
|
||||
public void setImageViewTileForUIIcon(ImageView imageView, int iconID) { imageView.setImageBitmap(preloadedTiles.getBitmap(iconID)); }
|
||||
|
||||
public void setImageViewTileForSingleItemType(Resources res, ImageView imageView, ItemType itemType) {
|
||||
final Bitmap icon = tileCache.loadSingleTile(itemType.iconID, res);
|
||||
setImageViewTile(res, imageView, itemType, icon);
|
||||
}
|
||||
public void setImageViewTile(Resources res, ImageView imageView, ItemType itemType, TileCollection itemTileCollection) {
|
||||
final Bitmap icon = itemTileCollection.getBitmap(itemType.iconID);
|
||||
setImageViewTile(res, imageView, itemType, icon);
|
||||
|
||||
@@ -140,7 +140,7 @@ public final class Savegames {
|
||||
}
|
||||
|
||||
private static final Pattern savegameFilenamePattern = Pattern.compile(Constants.FILENAME_SAVEGAME_FILENAME_PREFIX + "(\\d+)");
|
||||
public static List<Integer> getUsedSavegameSlots(Context androidContext) {
|
||||
public static List<Integer> getUsedSavegameSlots() {
|
||||
try {
|
||||
final List<Integer> result = new ArrayList<Integer>();
|
||||
getSavegameDirectory().listFiles(new FilenameFilter() {
|
||||
@@ -166,12 +166,6 @@ public final class Savegames {
|
||||
public final String playerName;
|
||||
public final String displayInfo;
|
||||
|
||||
public FileHeader(String playerName, String displayInfo) {
|
||||
this.fileversion = AndorsTrailApplication.CURRENT_VERSION;
|
||||
this.playerName = playerName;
|
||||
this.displayInfo = displayInfo;
|
||||
}
|
||||
|
||||
public String describe() {
|
||||
return playerName + ", " + displayInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user