Skip to content

Commit

Permalink
[ #42 ] Done all.
Browse files Browse the repository at this point in the history
Closes #42.
  • Loading branch information
ice1000 committed Dec 16, 2017
1 parent c2e2aa7 commit 0a2641e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
15 changes: 10 additions & 5 deletions build.gradle
Expand Up @@ -51,6 +51,7 @@ dependencies {
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}

//noinspection GroovyAssignabilityCheck
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }

jar { from { configurations.library.collect { it.isDirectory() ? it : zipTree(it) } } }
Expand Down Expand Up @@ -88,12 +89,16 @@ dokka {

task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'html'
outputDirectory = "$buildDir/javadoc"
outputDirectory = javadoc.destinationDir
}

artifacts {
fatJar
sourcesJar
dokkaJavadoc
task javadok(type: Jar, dependsOn: dokkaJavadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives fatJar
archives sourcesJar
archives javadok
}
19 changes: 19 additions & 0 deletions src/org/frice/Initializer.kt
Expand Up @@ -18,6 +18,11 @@ import javax.swing.UIManager
import javax.swing.WindowConstants
import kotlin.concurrent.thread

/**
* You're not expected to use this class yourself.
* @author ice1000
* @since v1.5.0
*/
@Suppress("ClassName")
object `{-# LANGUAGE Initializer #-}` {
init {
Expand Down Expand Up @@ -49,6 +54,13 @@ fun launch(game: GameFX) = launchFx(game)

fun launchFx(game: Class<out GameFX>) = launchFx(game.newInstance())

/**
* GameFX launcher.
* This is actually redundant, just to avoid naming conflict
*
* @author ice1000
* @since v1.5.0
*/
fun launchFx(game: GameFX) {
`{-# LANGUAGE Initializer #-}`
FManager.useJfx = true
Expand Down Expand Up @@ -79,6 +91,13 @@ fun launch(game: Game) {
FLog.v("Engine thread successfully created.")
}

/**
* Game launcher.
* For Game/GameFX.
*
* @author ice1000
* @since v1.5.0
*/
fun launch(c: Class<out FriceGame>) = c.newInstance().let { instance ->
`{-# LANGUAGE Initializer #-}`
when (instance) {
Expand Down

0 comments on commit 0a2641e

Please sign in to comment.