Added Kotlin!

This commit is contained in:
Yair Morgenstern 2018-02-23 15:36:13 +02:00
parent 397556f81f
commit 9253c40085
7 changed files with 23 additions and 13 deletions

View file

@ -1,6 +1,6 @@
android {
buildToolsVersion "26.0.2"
compileSdkVersion 25
compileSdkVersion 26
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'

View file

@ -1,5 +1,11 @@
buildscript {
ext.kotlinVersion = '1.2.21'
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
repositories {
mavenLocal()
@ -39,7 +45,7 @@ allprojects {
}
project(":desktop") {
apply plugin: "java"
apply plugin: "kotlin"
dependencies {
@ -53,6 +59,7 @@ project(":desktop") {
project(":android") {
apply plugin: "android"
apply plugin: "kotlin-android"
configurations { natives }
@ -75,7 +82,7 @@ project(":android") {
}
project(":ios") {
apply plugin: "java"
apply plugin: "kotlin"
apply plugin: "robovm"
@ -107,13 +114,13 @@ project(":html") {
}
project(":core") {
apply plugin: "java"
apply plugin: "kotlin"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
}
}

View file

@ -1,4 +1,4 @@
apply plugin: "java"
apply plugin: "kotlin"
sourceCompatibility = 1.6
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

View file

@ -91,15 +91,18 @@ public class CivilizationInfo {
String greatPerson = greatPeople.getNewGreatPerson();
if(greatPerson!=null) {
CityInfo randomCity = cities.getRandom();
placeUnitNearTile(cities.getRandom().cityLocation, greatPerson);
gameInfo.addNotification("A " + greatPerson + " has been born!", randomCity.cityLocation);
}
goldenAges.nextTurn(happiness);
}
public void addGreatPerson(String greatPerson){
CityInfo randomCity = cities.getRandom();
placeUnitNearTile(cities.getRandom().cityLocation, greatPerson);
gameInfo.addNotification("A " + greatPerson + " has been born!", randomCity.cityLocation);
}
public CivStats getStatsForNextTurn() {
CivStats statsForTurn = new CivStats();
for (CityInfo city : cities) {

View file

@ -215,7 +215,7 @@ public class Building extends NamedStats implements IConstruction, ICivilopedia
constructions.builtBuildings.add(providesFreeBuilding);
if (freeTechs != 0) civInfo.tech.freeTechs += freeTechs;
if("EmpireEntersGoldenAge".equals(unique)) civInfo.goldenAges.enterGoldenAge();
if("FreeGreatArtistAppears".equals(unique)) civInfo.greatPeople.addGreatPerson("Great Artist");
if("FreeGreatArtistAppears".equals(unique)) civInfo.addGreatPerson("Great Artist");
if("WorkerConstruction".equals(unique)){
civInfo.placeUnitNearTile(constructions.cityInfo.cityLocation,"Worker");
civInfo.placeUnitNearTile(constructions.cityInfo.cityLocation,"Worker");

View file

@ -1,4 +1,4 @@
apply plugin: "java"
apply plugin: "kotlin"
sourceCompatibility = 1.6
sourceSets.main.java.srcDirs = [ "src/" ]

View file

@ -1,6 +1,6 @@
import de.richsource.gradle.plugins.gwt.GwtSuperDev
apply plugin: "java"
apply plugin: "kotlin"
apply plugin: "jetty"
gwt {