A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/AlmasB/FXGL/commit/02203774c below:

added PropertyMap multiply Double and Int · AlmasB/FXGL@0220377 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+20

-0

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+20

-0

lines changed Original file line number Diff line number Diff line change

@@ -157,6 +157,14 @@ class PropertyMap {

157 157

doubleProperty(propertyName).value += value

158 158

}

159 159 160 +

fun multiply(propertyName: String, value: Int) {

161 +

intProperty(propertyName).value *= value

162 +

}

163 + 164 +

fun multiply(propertyName: String, value: Double) {

165 +

doubleProperty(propertyName).value *= value

166 +

}

167 + 160 168

fun getBoolean(propertyName: String) = booleanProperty(propertyName).value

161 169 162 170

fun getInt(propertyName: String) = intProperty(propertyName).value

Original file line number Diff line number Diff line change

@@ -117,6 +117,18 @@ class PropertyMapTest {

117 117

assertThat(map.getDouble("key3"), `is`(800.0))

118 118

}

119 119 120 +

@Test

121 +

fun `Multiply Double and Int`() {

122 +

map.setValue("key2", -55)

123 +

map.setValue("key3", 900.0)

124 + 125 +

map.multiply("key2", 2)

126 +

assertThat(map.getInt("key2"), `is`(-110))

127 + 128 +

map.multiply("key3", -100.0)

129 +

assertThat(map.getDouble("key3"), `is`(-90000.0))

130 +

}

131 + 120 132

@Test

121 133

fun `Listeners`() {

122 134

var count = 0

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4