1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-22 16:47:13 +00:00

add one more flatMatrix

This commit is contained in:
InsanusMokrassar 2020-06-24 20:54:22 +06:00
parent 2acb177ad6
commit 7507c107b4

View File

@ -24,6 +24,12 @@ fun <T> flatMatrix(block: RowBuilder<T>.() -> Unit): Matrix<T> {
}.matrix
}
fun <T> flatMatrix(vararg elements: T): Matrix<T> {
return MatrixBuilder<T>().apply {
row { elements.forEach { +it } }
}.matrix
}
operator fun <T> RowBuilder<T>.plus(t: T) = add(t)
class RowBuilder<T> {