File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
main/kotlin/com/almasb/fxgl/core/collection
test/kotlin/com/almasb/fxgl/core/collection Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,14 @@ class PropertyMap {
165
165
doubleProperty(propertyName).value * = value
166
166
}
167
167
168
+ fun divide (propertyName : String , value : Int ) {
169
+ intProperty(propertyName).value / = value
170
+ }
171
+
172
+ fun divide (propertyName : String , value : Double ) {
173
+ doubleProperty(propertyName).value / = value
174
+ }
175
+
168
176
fun getBoolean (propertyName : String ) = booleanProperty(propertyName).value
169
177
170
178
fun getInt (propertyName : String ) = intProperty(propertyName).value
Original file line number Diff line number Diff line change @@ -129,6 +129,18 @@ class PropertyMapTest {
129
129
assertThat(map.getDouble(" key3" ), `is `(- 90000.0 ))
130
130
}
131
131
132
+ @Test
133
+ fun `Divide Double and Int` () {
134
+ map.setValue(" key2" , - 55 )
135
+ map.setValue(" key3" , 900.0 )
136
+
137
+ map.divide(" key2" , 5 )
138
+ assertThat(map.getInt(" key2" ), `is `(- 11 ))
139
+
140
+ map.divide(" key3" , - 100.0 )
141
+ assertThat(map.getDouble(" key3" ), `is `(- 9.0 ))
142
+ }
143
+
132
144
@Test
133
145
fun `Listeners` () {
134
146
var count = 0
You can’t perform that action at this time.
0 commit comments