-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from AzisabaNetwork/master
最新化
- Loading branch information
Showing
2 changed files
with
40 additions
and
10 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,18 +1,45 @@ | ||
package dev.felnull.Data; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.HashMap; | ||
import java.util.HashSet; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
public class GroupData { | ||
public final String groupName; //グループ名 プレイヤー個人の場合はプレイヤーUUID | ||
public Set<Player> playerList; //グループ所属のプレイヤーリスト 最低1つは格納されるはず | ||
public Map<Player,String[]> playerPermission; //プレイヤーが保持している役職 //StringじゃなくてENUMでやるべきかもです | ||
public GroupData (String groupName, Set<Player> playerList, Map<Player,String[]> playerPermission) { | ||
public Map<Player,String[]> playerPermission; //プレイヤーが保持している役職 | ||
public boolean isPrivate; //個人用グループか否か | ||
public StorageData storageData; //グループ保有のストレージデータ null許容 | ||
|
||
public GroupData (@NotNull String groupName,@NotNull Set<Player> playerList,@NotNull Map<Player,String[]> playerPermission, boolean isPrivate, StorageData storageData) { | ||
this.groupName = groupName; | ||
this.playerList = playerList; | ||
this.playerPermission = playerPermission; | ||
this.isPrivate = isPrivate; | ||
storageData.groupName = groupName; | ||
storageData.groupData = this; | ||
this.storageData = storageData; | ||
} | ||
|
||
public GroupData (@NotNull Player player, StorageData storageData) { | ||
this.groupName = player.getUniqueId().toString(); | ||
|
||
//引数で得たプレイヤーをメンバに追加してowner権限を付与する | ||
playerList = new HashSet<>(); | ||
playerPermission = new HashMap<>(); | ||
playerList.add(player); | ||
String[] permission = {GroupPermENUM.OWNER.getPermName()}; | ||
playerPermission.put(player, permission ); | ||
//個人用を想定したコンストラクタなのでtrue | ||
this.isPrivate = true; | ||
|
||
storageData.groupName = groupName; | ||
storageData.groupData = this; | ||
this.storageData = storageData; | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,22 +1,25 @@ | ||
package dev.felnull.Data; | ||
|
||
import org.bukkit.inventory.Inventory; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
public class StorageData { | ||
public final String groupName;//グループ名(個人プレイヤーもグループ扱い) | ||
public final boolean personal;//個人用かグループ用かのフラグ | ||
public String groupName;//グループ名(個人プレイヤーもグループ扱い) | ||
public GroupData groupData;//ストレージの所属グループ | ||
public final Set<String> requireBankPermission;//ストレージ直下の金庫の要求パーミッション(BukkitPermではない) | ||
public int bankMoney;//ストレージ付属金庫の値 | ||
public Map<String,InventoryData> storageInventry;//ストレージに含まれているインベントリデータ キーのStringはページ名 | ||
@NotNull | ||
public Map<String,InventoryData> storageInventory;//ストレージに含まれているインベントリデータ キーのStringはページ名 | ||
|
||
public StorageData(String groupName, boolean personal, Set<String> requireBankPermission, Map<String,InventoryData> storageInventry, int bankMoney) { | ||
this.groupName = groupName; | ||
this.personal = personal; | ||
public StorageData(@NotNull Set<String> requireBankPermission, Map<String,InventoryData> storageInventory, int bankMoney) { | ||
this.requireBankPermission = requireBankPermission; | ||
this.storageInventry = storageInventry; | ||
if(storageInventory == null){ | ||
storageInventory = new HashMap<>(); | ||
} | ||
this.storageInventory = storageInventory; | ||
this.bankMoney = bankMoney; | ||
} | ||
} |