Fix Java 8

This commit is contained in:
Yohann D'ANELLO 2020-05-26 17:48:10 +02:00
parent 787394ed76
commit 10fb067de2
1 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import javax.imageio.ImageIO
import net.liftweb.json._ import net.liftweb.json._
import scala.collection.mutable.ListBuffer import scala.collection.mutable.ListBuffer
import scala.io.Source
object SpriteRegister { object SpriteRegister {
private var nameToCoords = Map(): Map[String, List[List[Int]]] private var nameToCoords = Map(): Map[String, List[List[Int]]]
@ -77,7 +78,7 @@ object SpriteRegister {
try { try {
val f = new File(assetsDir.getAbsolutePath + "/" + asset + "/textures/sprites") val f = new File(assetsDir.getAbsolutePath + "/" + asset + "/textures/sprites")
assert(f.isDirectory || f.mkdirs) assert(f.isDirectory || f.mkdirs)
val json = Files.readString(new File(f, "sprites.json").toPath) val json = Source.fromFile(new File(f, "sprites.json")).mkString
implicit val formats: DefaultFormats.type = DefaultFormats implicit val formats: DefaultFormats.type = DefaultFormats
nameToCoords = parse(json).extract[Map[String, List[List[Int]]]] nameToCoords = parse(json).extract[Map[String, List[List[Int]]]]
nameToCoords.keySet.foreach(key => { nameToCoords.keySet.foreach(key => {