Skip to content

Commit

Permalink
Added Kotlin!
Browse files Browse the repository at this point in the history
  • Loading branch information
yairm210 committed Feb 23, 2018
1 parent 397556f commit 9253c40
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
android {
buildToolsVersion "26.0.2"
compileSdkVersion 25
compileSdkVersion 26
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
Expand Down
17 changes: 12 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
buildscript {


ext.kotlinVersion = '1.2.21'

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}


repositories {
mavenLocal()
Expand Down Expand Up @@ -39,7 +45,7 @@ allprojects {
}

project(":desktop") {
apply plugin: "java"
apply plugin: "kotlin"


dependencies {
Expand All @@ -53,6 +59,7 @@ project(":desktop") {

project(":android") {
apply plugin: "android"
apply plugin: "kotlin-android"

configurations { natives }

Expand All @@ -75,7 +82,7 @@ project(":android") {
}

project(":ios") {
apply plugin: "java"
apply plugin: "kotlin"
apply plugin: "robovm"


Expand Down Expand Up @@ -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"
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply plugin: "java"
apply plugin: "kotlin"

sourceCompatibility = 1.6
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
Expand Down
9 changes: 6 additions & 3 deletions core/src/com/unciv/logic/civilization/CivilizationInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,18 @@ public void nextTurn()

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) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/com/unciv/models/gamebasics/Building.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public void postBuildEvent(CityConstructions constructions) {
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");
Expand Down
2 changes: 1 addition & 1 deletion desktop/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply plugin: "java"
apply plugin: "kotlin"

sourceCompatibility = 1.6
sourceSets.main.java.srcDirs = [ "src/" ]
Expand Down
2 changes: 1 addition & 1 deletion html/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import de.richsource.gradle.plugins.gwt.GwtSuperDev

apply plugin: "java"
apply plugin: "kotlin"
apply plugin: "jetty"

gwt {
Expand Down

0 comments on commit 9253c40

Please sign in to comment.