Skip to content

Commit

Permalink
Lintfix
Browse files Browse the repository at this point in the history
  • Loading branch information
dwursteisen committed Feb 16, 2024
1 parent 01304ad commit 67f2a19
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class RunCommand : CliktCommand(name = "run", help = "Run your game.") {
)

val data = File("data")
if(data.exists() && data.isDirectory) {
if (data.exists() && data.isDirectory) {
WorkspaceLib.DEFAULT = data.listFiles().map { JvmLocalFile(it.name, data) }
}
gameEngine.main()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,6 @@ class DebugLib(private val resourceAccess: GameResourceAccess) : TwoArgFunction(

private val recursiveSecurity = mutableSetOf<Int>()




@TinyCall("Log a message into the console.")
override fun call(@TinyArg("str") arg: LuaValue): LuaValue {
val str = formatValue(arg)
Expand All @@ -222,8 +219,8 @@ class DebugLib(private val resourceAccess: GameResourceAccess) : TwoArgFunction(

private fun formatValue(arg: LuaValue): String = if (arg.istable()) {
val table = arg as LuaTable
if(recursiveSecurity.contains(table.hashCode())) {
"table[<${table.hashCode()}>]"
if (recursiveSecurity.contains(table.hashCode())) {
"table[<${table.hashCode()}>]"
} else {
recursiveSecurity.add(table.hashCode())
val keys = table.keys()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class JvmLocalFile(
}

override fun save(content: ByteArray) {
if(!workingDirectory.exists()) {
if (!workingDirectory.exists()) {
workingDirectory.mkdirs()
}
workingDirectory.resolve(file).writeBytes(content)
Expand Down

0 comments on commit 67f2a19

Please sign in to comment.