mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-03 12:54:43 +07:00
Added Kotlin!
This commit is contained in:
parent
397556f81f
commit
9253c40085
@ -1,6 +1,6 @@
|
|||||||
android {
|
android {
|
||||||
buildToolsVersion "26.0.2"
|
buildToolsVersion "26.0.2"
|
||||||
compileSdkVersion 25
|
compileSdkVersion 26
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
manifest.srcFile 'AndroidManifest.xml'
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
|
17
build.gradle
17
build.gradle
@ -1,5 +1,11 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
|
|
||||||
|
ext.kotlinVersion = '1.2.21'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
@ -39,7 +45,7 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
project(":desktop") {
|
project(":desktop") {
|
||||||
apply plugin: "java"
|
apply plugin: "kotlin"
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@ -53,6 +59,7 @@ project(":desktop") {
|
|||||||
|
|
||||||
project(":android") {
|
project(":android") {
|
||||||
apply plugin: "android"
|
apply plugin: "android"
|
||||||
|
apply plugin: "kotlin-android"
|
||||||
|
|
||||||
configurations { natives }
|
configurations { natives }
|
||||||
|
|
||||||
@ -75,7 +82,7 @@ project(":android") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
project(":ios") {
|
project(":ios") {
|
||||||
apply plugin: "java"
|
apply plugin: "kotlin"
|
||||||
apply plugin: "robovm"
|
apply plugin: "robovm"
|
||||||
|
|
||||||
|
|
||||||
@ -107,13 +114,13 @@ project(":html") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
project(":core") {
|
project(":core") {
|
||||||
apply plugin: "java"
|
apply plugin: "kotlin"
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||||
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
|
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
|
||||||
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
apply plugin: "java"
|
apply plugin: "kotlin"
|
||||||
|
|
||||||
sourceCompatibility = 1.6
|
sourceCompatibility = 1.6
|
||||||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||||
|
@ -91,15 +91,18 @@ public class CivilizationInfo {
|
|||||||
|
|
||||||
String greatPerson = greatPeople.getNewGreatPerson();
|
String greatPerson = greatPeople.getNewGreatPerson();
|
||||||
if(greatPerson!=null) {
|
if(greatPerson!=null) {
|
||||||
CityInfo randomCity = cities.getRandom();
|
|
||||||
placeUnitNearTile(cities.getRandom().cityLocation, greatPerson);
|
|
||||||
gameInfo.addNotification("A " + greatPerson + " has been born!", randomCity.cityLocation);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
goldenAges.nextTurn(happiness);
|
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() {
|
public CivStats getStatsForNextTurn() {
|
||||||
CivStats statsForTurn = new CivStats();
|
CivStats statsForTurn = new CivStats();
|
||||||
for (CityInfo city : cities) {
|
for (CityInfo city : cities) {
|
||||||
|
@ -215,7 +215,7 @@ public class Building extends NamedStats implements IConstruction, ICivilopedia
|
|||||||
constructions.builtBuildings.add(providesFreeBuilding);
|
constructions.builtBuildings.add(providesFreeBuilding);
|
||||||
if (freeTechs != 0) civInfo.tech.freeTechs += freeTechs;
|
if (freeTechs != 0) civInfo.tech.freeTechs += freeTechs;
|
||||||
if("EmpireEntersGoldenAge".equals(unique)) civInfo.goldenAges.enterGoldenAge();
|
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)){
|
if("WorkerConstruction".equals(unique)){
|
||||||
civInfo.placeUnitNearTile(constructions.cityInfo.cityLocation,"Worker");
|
civInfo.placeUnitNearTile(constructions.cityInfo.cityLocation,"Worker");
|
||||||
civInfo.placeUnitNearTile(constructions.cityInfo.cityLocation,"Worker");
|
civInfo.placeUnitNearTile(constructions.cityInfo.cityLocation,"Worker");
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
apply plugin: "java"
|
apply plugin: "kotlin"
|
||||||
|
|
||||||
sourceCompatibility = 1.6
|
sourceCompatibility = 1.6
|
||||||
sourceSets.main.java.srcDirs = [ "src/" ]
|
sourceSets.main.java.srcDirs = [ "src/" ]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import de.richsource.gradle.plugins.gwt.GwtSuperDev
|
import de.richsource.gradle.plugins.gwt.GwtSuperDev
|
||||||
|
|
||||||
apply plugin: "java"
|
apply plugin: "kotlin"
|
||||||
apply plugin: "jetty"
|
apply plugin: "jetty"
|
||||||
|
|
||||||
gwt {
|
gwt {
|
||||||
|
Loading…
Reference in New Issue
Block a user