Search in sources :

Example 1 with DatabaseData

use of com.alessiodp.parties.storage.DatabaseData in project Parties by AlessioDP.

the class FileDispatcher method loadEntireData.

@Override
public DatabaseData loadEntireData() {
    // Players
    Map<UUID, PartyPlayer> players = new HashMap<UUID, PartyPlayer>();
    for (PartyPlayer pp : getAllPlayers()) players.put(pp.getPlayerUUID(), pp);
    // Parties
    Map<String, Party> parties = new HashMap<String, Party>();
    for (Party p : getAllParties()) parties.put(p.getName(), p);
    return new DatabaseData(players, parties);
}
Also used : Party(com.alessiodp.partiesapi.objects.Party) PartyPlayer(com.alessiodp.partiesapi.objects.PartyPlayer) HashMap(java.util.HashMap) UUID(java.util.UUID) DatabaseData(com.alessiodp.parties.storage.DatabaseData)

Example 2 with DatabaseData

use of com.alessiodp.parties.storage.DatabaseData in project Parties by AlessioDP.

the class SQLDispatcher method loadEntireData.

@Override
public DatabaseData loadEntireData() {
    // Players
    Map<UUID, PartyPlayer> players = new HashMap<UUID, PartyPlayer>();
    for (PartyPlayer pp : getAllPlayers()) players.put(pp.getPlayerUUID(), pp);
    // Parties
    Map<String, Party> parties = new HashMap<String, Party>();
    for (Party p : getAllParties()) parties.put(p.getName(), p);
    return new DatabaseData(players, parties);
}
Also used : Party(com.alessiodp.partiesapi.objects.Party) PartyPlayer(com.alessiodp.partiesapi.objects.PartyPlayer) HashMap(java.util.HashMap) UUID(java.util.UUID) DatabaseData(com.alessiodp.parties.storage.DatabaseData)

Aggregations

DatabaseData (com.alessiodp.parties.storage.DatabaseData)2 Party (com.alessiodp.partiesapi.objects.Party)2 PartyPlayer (com.alessiodp.partiesapi.objects.PartyPlayer)2 HashMap (java.util.HashMap)2 UUID (java.util.UUID)2