From c56c7f72b02a360e54e398886e3ad45038f340e7 Mon Sep 17 00:00:00 2001 From: sya-ri Date: Wed, 13 May 2020 23:00:48 +0900 Subject: [PATCH] =?UTF-8?q?PlayerDataList.kt=20=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../me/syari/ss/core/code/PlayerDataList.kt | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 src/main/kotlin/me/syari/ss/core/code/PlayerDataList.kt diff --git a/src/main/kotlin/me/syari/ss/core/code/PlayerDataList.kt b/src/main/kotlin/me/syari/ss/core/code/PlayerDataList.kt deleted file mode 100644 index 40da87d..0000000 --- a/src/main/kotlin/me/syari/ss/core/code/PlayerDataList.kt +++ /dev/null @@ -1,32 +0,0 @@ -package me.syari.ss.core.code - -import me.syari.ss.core.player.UUIDPlayer -import org.bukkit.OfflinePlayer - -/** - * プレイヤーのデータを保存します - * @param T 保存するデータ型 - */ -class PlayerDataList { - private val map = mutableMapOf() - - /** - * プレイヤーのデータを取得します - * @param uuidPlayer 指定プレイヤー - * @param initialize デフォルト値 - * @return [T] - */ - fun get(uuidPlayer: UUIDPlayer, initialize: () -> T): T { - return map.getOrPut(uuidPlayer, initialize) - } - - /** - * プレイヤーのデータを取得します - * @param player 指定プレイヤー - * @param initialize デフォルト値 - * @return [T] - */ - fun get(player: OfflinePlayer, initialize: () -> T): T { - return get(UUIDPlayer(player), initialize) - } -} \ No newline at end of file