diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-07-23 14:04:53 +0900 |
|---|---|---|
| committer | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-07-23 14:04:53 +0900 |
| commit | 886510d721f21e73972477bc8c8abbe71c1247bf (patch) | |
| tree | fad311ac0cab71d3340020f0d6fde18f23a600bc /src/client | |
| parent | Fix semantic errors (diff) | |
| download | misskey-886510d721f21e73972477bc8c8abbe71c1247bf.tar.gz misskey-886510d721f21e73972477bc8c8abbe71c1247bf.tar.bz2 misskey-886510d721f21e73972477bc8c8abbe71c1247bf.zip | |
Clean up
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/common/views/components/games/reversi/reversi.room.vue | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client/app/common/views/components/games/reversi/reversi.room.vue b/src/client/app/common/views/components/games/reversi/reversi.room.vue index 03152dcf19..841f6b366a 100644 --- a/src/client/app/common/views/components/games/reversi/reversi.room.vue +++ b/src/client/app/common/views/components/games/reversi/reversi.room.vue @@ -112,7 +112,7 @@ export default Vue.extend({ computed: { mapCategories(): string[] { - const categories = Object.entries(maps).map(x => x[1].category); + const categories = Object.values(maps).map(x => x.category); return categories.filter((item, pos) => categories.indexOf(item) == pos); }, isAccepted(): boolean { @@ -179,8 +179,8 @@ export default Vue.extend({ if (this.game.settings.map == null) { this.mapName = null; } else { - const foundMap = Object.entries(maps).find(x => x[1].data.join('') == this.game.settings.map.join('')); - this.mapName = foundMap ? foundMap[1].name : '-Custom-'; + const found = Object.values(maps).find(x => x.data.join('') == this.game.settings.map.join('')); + this.mapName = found ? found.name : '-Custom-'; } }, @@ -206,7 +206,7 @@ export default Vue.extend({ if (v == null) { this.game.settings.map = null; } else { - this.game.settings.map = Object.entries(maps).find(x => x[1].name == v)[1].data; + this.game.settings.map = Object.values(maps).find(x => x.name == v).data; } this.$forceUpdate(); this.updateSettings(); @@ -217,9 +217,9 @@ export default Vue.extend({ const y = Math.floor(pos / this.game.settings.map[0].length); const newPixel = pixel == ' ' ? '-' : - pixel == '-' ? 'b' : - pixel == 'b' ? 'w' : - ' '; + pixel == '-' ? 'b' : + pixel == 'b' ? 'w' : + ' '; const line = this.game.settings.map[y].split(''); line[x] = newPixel; this.$set(this.game.settings.map, y, line.join('')); |