mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-16 08:36:07 +09:00
compressed fonts, lightmap histogram
Former-commit-id: 2fd36e0b2b7cd45ecdab628e0d2679efd17f01f3 Former-commit-id: 5c4109d7a2ce320584674c5415054a381ba4d6ec
This commit is contained in:
@@ -7,7 +7,7 @@ import java.util.Random
|
||||
*/
|
||||
class Fudge3
|
||||
/**
|
||||
* Define new set of fudge dice with three dice.
|
||||
* Define new set of Fudge dice with three dice (3dF).
|
||||
* @param randfunc java.util.Random or its extension
|
||||
*/
|
||||
(randfunc: Random) : FudgeDice(randfunc, 3)
|
||||
|
||||
@@ -7,20 +7,20 @@ import java.util.Random
|
||||
*/
|
||||
open class FudgeDice
|
||||
/**
|
||||
* Define new set of fudge dice with given counts.
|
||||
* Define new set of Fudge dice with given counts.
|
||||
* @param randfunc java.util.Random or its extension
|
||||
* *
|
||||
* @param counts amount of die
|
||||
*/
|
||||
(private val randfunc: Random, val diceCounts: Int) {
|
||||
(private val randfunc: Random, val diceCount: Int) {
|
||||
|
||||
/**
|
||||
* Roll dice and get result.
|
||||
* @return Normal distributed integer [-N , N] for diceCount of N. 0 is the most frequent return.
|
||||
* @return Normally distributed integer [-N , N] for diceCount of N. 0 is the most frequent return.
|
||||
*/
|
||||
fun roll(): Int {
|
||||
var diceResult = 0
|
||||
for (c in 0..diceCounts - 1) {
|
||||
for (c in 0..diceCount - 1) {
|
||||
diceResult += rollSingleDie()
|
||||
}
|
||||
|
||||
@@ -29,14 +29,14 @@ open class FudgeDice
|
||||
|
||||
/**
|
||||
* Roll dice and get result, for array index
|
||||
* @return Normal distributed integer [0 , N] for N = 2 × DiceCounts + 1. 0 is the most frequent return.
|
||||
* @return Normally distributed integer [0 , N] for N = 2 × DiceCounts + 1. 0 is the most frequent return.
|
||||
*/
|
||||
fun rollForArray(): Int {
|
||||
return roll() + diceCounts
|
||||
return roll() + diceCount
|
||||
}
|
||||
|
||||
val sizeOfProbabilityRange: Int
|
||||
get() = 2 * diceCounts + 1
|
||||
get() = 2 * diceCount + 1
|
||||
|
||||
/**
|
||||
* @return integer randomly picked from {-1, 0, 1}
|
||||
|
||||
Reference in New Issue
Block a user