mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Fixed fileParser in order to read time scale in decimal
- json-simple can read either long or double. Updated getScaleTime to make it capable to read a decimal number. #fix #story[5]
This commit is contained in:
@@ -54,12 +54,13 @@ public class FileParser {
|
||||
* negative number, or containing non numeric character) or cannot be found.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public long getTimeScale() {
|
||||
public double getTimeScale() {
|
||||
try {
|
||||
long timeScale = (long) this.content.get("time-scale");
|
||||
double timeScale = (double) this.content.get("time-scale");
|
||||
return timeScale >= 0 ? timeScale : -1;
|
||||
} catch (Exception e) {
|
||||
return -1;
|
||||
e.printStackTrace();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user