-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start including context data in BehaviourContext
- Loading branch information
1 parent
082aeab
commit 3658403
Showing
3 changed files
with
17 additions
and
3 deletions.
There are no files selected for viewing
3 changes: 0 additions & 3 deletions
3
...src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourBuilders.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
.../commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package dev.inmo.tgbotapi.extensions.behaviour_builder | ||
|
||
data class BehaviourContextData( | ||
val data: MutableMap<String, Any?> = mutableMapOf() | ||
) { | ||
fun mergedWith(other: BehaviourContextData): BehaviourContextData = BehaviourContextData( | ||
data.toMutableMap().apply { | ||
putAll(other.data) | ||
} | ||
) | ||
|
||
operator fun plus(other: BehaviourContextData): BehaviourContextData = mergedWith(other) | ||
} |