1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +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 }.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) operator fun <T> RowBuilder<T>.plus(t: T) = add(t)
class RowBuilder<T> { class RowBuilder<T> {