TechManager

class TechManager

Functions

addCurrentScienceToScienceOfLast8Turns
Link copied to clipboard
private fun addCurrentScienceToScienceOfLast8Turns()
addScience
Link copied to clipboard
fun addScience(scienceGet: Int)
addTechnology
Link copied to clipboard
fun addTechnology(techName: String)
addTechToTransients
Link copied to clipboard
fun addTechToTransients(tech: Technology)
canBeResearched
Link copied to clipboard
fun canBeResearched(techName: String): Boolean
canResearchTech
Link copied to clipboard
fun canResearchTech(): Boolean
clone
Link copied to clipboard
fun clone(): TechManager
costOfTech
Link copied to clipboard
fun costOfTech(techName: String): Int
currentTechnology
Link copied to clipboard
fun currentTechnology(): Technology?
currentTechnologyName
Link copied to clipboard
fun currentTechnologyName(): String?
endTurn
Link copied to clipboard
fun endTurn(scienceForNewTurn: Int)
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
getBestRoadAvailable
Link copied to clipboard
fun getBestRoadAvailable(): RoadStatus
getFreeTechnology
Link copied to clipboard
fun getFreeTechnology(techName: String)
getNumberOfTechsResearched
Link copied to clipboard
fun getNumberOfTechsResearched(): Int
getRequiredTechsToDestination
Link copied to clipboard
fun getRequiredTechsToDestination(destinationTech: Technology): List<Technology>
getRuleset
Link copied to clipboard
private fun getRuleset(): Ruleset
getScienceFromGreatScientist
Link copied to clipboard
fun getScienceFromGreatScientist(): Int
hashCode
Link copied to clipboard
open fun hashCode(): Int
isResearched
Link copied to clipboard
fun isResearched(techName: String): Boolean
limitOverflowScience
Link copied to clipboard
private fun limitOverflowScience(overflowScience: Int): Int
remainingScienceToTech
Link copied to clipboard
fun remainingScienceToTech(techName: String): Int
researchOfTech
Link copied to clipboard
fun researchOfTech(TechName: String?): Int
scienceFromResearchAgreements
Link copied to clipboard
private fun scienceFromResearchAgreements(): Int
setTransients
Link copied to clipboard
fun setTransients()
toString
Link copied to clipboard
open fun toString(): String
turnsToTech
Link copied to clipboard
fun turnsToTech(techName: String): String
updateTransientBooleans
Link copied to clipboard
private fun updateTransientBooleans()

Properties

civInfo
Link copied to clipboard
lateinit var civInfo: CivilizationInfo
embarkedUnitsCanEnterOcean
Link copied to clipboard
var embarkedUnitsCanEnterOcean: Boolean = false
freeTechs
Link copied to clipboard
var freeTechs: Int = 0
goldPercentConvertedToScience
Link copied to clipboard
var goldPercentConvertedToScience: Float = 0.6f

In civ IV, you can auto-convert a certain percentage of gold in cities to science

movementSpeedOnRoads
Link copied to clipboard
var movementSpeedOnRoads: Float = 1f
overflowScience
Link copied to clipboard
var overflowScience: Int = 0
researchedTechnologies
Link copied to clipboard
var researchedTechnologies: ArrayList<Technology>

This is the Transient list of Technologies

roadsConnectAcrossRivers
Link copied to clipboard
var roadsConnectAcrossRivers: Boolean = false
scienceFromResearchAgreements
Link copied to clipboard
var scienceFromResearchAgreements: Int = 0
scienceOfLast8Turns
Link copied to clipboard
var scienceOfLast8Turns: IntArray

For calculating Great Scientist yields - see https://civilization.fandom.com/wiki/Great_Scientist_(Civ5)

techsInProgress
Link copied to clipboard
var techsInProgress: HashMap<String, Int>
techsResearched
Link copied to clipboard
var techsResearched: HashSet<String>

This is the lit of strings, which is serialized

techsToResearch
Link copied to clipboard
var techsToResearch: ArrayList<String>

When moving towards a certain tech, the user doesn't have to manually pick every one.

techUniques
Link copied to clipboard
internal var techUniques: UniqueMap
unitsCanEmbark
Link copied to clipboard
var unitsCanEmbark: Boolean = false
wayfinding
Link copied to clipboard
var wayfinding: Boolean = false

Extensions

replaceUpdatedTechName
Link copied to clipboard
private fun TechManager.replaceUpdatedTechName(oldTechName: String, newTechName: String)

Replace a changed tech name

Sources

jvm source
Link copied to clipboard