NamedStats

open class NamedStats : Stats, INamed

Functions

add
Link copied to clipboard
fun add(other: Stats)

Adds each value of another Stats instance to this one in place

fun add(stat: Stat, value: Float): Stats

Adds the value parameter to the instance value specified by stat in place

asSequence
Link copied to clipboard
fun asSequence(): Sequence<Stats.StatValuePair>

Enables iteration over the non-zero Stat/value pairs. Explicit use unnecessary - Stats is iterable directly.

clear
Link copied to clipboard
fun clear()

Reset all values to zero (in place)

clone
Link copied to clipboard
fun clone(): Stats
cloneStats
Link copied to clipboard
fun cloneStats(): Stats
div
Link copied to clipboard
operator fun div(number: Float): Stats
equals
Link copied to clipboard
fun equals(otherStats: Stats): Boolean

Compares two instances. Not callable via ==.

open operator fun equals(other: Any?): Boolean
forEach
Link copied to clipboard
open fun forEach(p0: Consumer<in Stats.StatValuePair>)
get
Link copied to clipboard
operator fun get(stat: Stat): Float

Indexed read of a value for a given Stat, e.g. this.gold == this[Stat.Gold]

hashCode
Link copied to clipboard
open fun hashCode(): Int
isEmpty
Link copied to clipboard
fun isEmpty(): Boolean
iterator
Link copied to clipboard
open operator override fun iterator(): Iterator<Stats.StatValuePair>

Returns an iterator over the elements of this object, wrapped as StatValuePairs

plus
Link copied to clipboard
operator fun plus(stats: Stats): Stats
set
Link copied to clipboard
operator fun set(stat: Stat, value: Float)

Indexed write of a value for a given Stat, e.g. this.gold += 1f is equivalent to this[Stat.Gold] += 1f

spliterator
Link copied to clipboard
open fun spliterator(): Spliterator<Stats.StatValuePair>
times
Link copied to clipboard
operator fun times(number: Float): Stats
operator fun times(number: Int): Stats
timesInPlace
Link copied to clipboard
fun timesInPlace(number: Float)

Multiplies each value of this instance by number in place

toString
Link copied to clipboard
open override fun toString(): String

Not only a debug helper. It returns a string representing the content, already translated.

toStringWithDecimals
Link copied to clipboard
fun toStringWithDecimals(): String

Properties

culture
Link copied to clipboard
var culture: Float = 0f
faith
Link copied to clipboard
var faith: Float = 0f
food
Link copied to clipboard
var food: Float = 0f
gold
Link copied to clipboard
var gold: Float = 0f
happiness
Link copied to clipboard
var happiness: Float = 0f
mapView
Link copied to clipboard
private val mapView: Map<Stat, KMutableProperty0<Float>>
name
Link copied to clipboard
open lateinit override var name: String
production
Link copied to clipboard
var production: Float = 0f
science
Link copied to clipboard
var science: Float = 0f
values
Link copied to clipboard
val values: Sequence<Float>

Enables aggregates over the values, never empty

Inheritors

Specialist
Link copied to clipboard
RulesetStatsObject
Link copied to clipboard

Sources

jvm source
Link copied to clipboard