Some changes

Fixes #605
Possibly #604
Other minor tweaks
This commit is contained in:
boy0001
2015-09-03 15:45:25 +10:00
parent 3a29022d19
commit afef79ea66
31 changed files with 195 additions and 146 deletions

View File

@ -542,6 +542,31 @@ public class Plot {
PlotAnalysis.analyzePlot(this, whenDone);
}
/**
* Set a flag for this plot
* @param flag
* @param value
*/
public void setFlag(String flag, Object value) {
FlagManager.addPlotFlag(this, new Flag(FlagManager.getFlag(flag), value));
}
/**
* Remove a flag from this plot
* @param flag
*/
public void removeFlag(String flag) {
FlagManager.removePlotFlag(this, flag);
}
/**
* Get the flag for a given key
* @param flag
*/
public Flag getFlag(String key) {
return FlagManager.getPlotFlag(this, key);
}
/**
* Delete a plot
* @see PS#removePlot(String, PlotId, boolean)

View File

@ -18,7 +18,15 @@ public class Rating {
private int initial;
public Rating(int value) {
this.initial = value;
ratingMap = new HashMap<>();
if (value < 10) {
for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) {
ratingMap.put(Settings.RATING_CATEGORIES.get(i), value);
}
changed = true;
return;
}
if (Settings.RATING_CATEGORIES != null && Settings.RATING_CATEGORIES.size() > 1) {
for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) {
ratingMap.put(Settings.RATING_CATEGORIES.get(i), (value % 10) - 1);
@ -28,7 +36,6 @@ public class Rating {
else {
ratingMap.put(null, value);
}
this.initial = value;
}
public List<String> getCategories() {