Search in sources :

Example 1 with SoliniaLootTableEntry

use of com.solinia.solinia.Models.SoliniaLootTableEntry in project solinia3-core by mixxit.

the class SoliniaLootFactory method CreateLootTableDrop.

public static void CreateLootTableDrop(int loottableid, int lootdropid, boolean operatorCreated) throws CoreStateInitException {
    ISoliniaLootTable loottabletable = StateManager.getInstance().getConfigurationManager().getLootTable(loottableid);
    SoliniaLootTableEntry loottable = new SoliniaLootTableEntry();
    int id = 1;
    for (ISoliniaLootTableEntry entry : loottabletable.getEntries()) {
        if (entry.getId() > id)
            id = entry.getId() + 1;
    }
    loottable.setId(id);
    loottable.setLoottableid(loottableid);
    loottable.setLootdropid(lootdropid);
    loottable.setOperatorCreated(operatorCreated);
    StateManager.getInstance().getConfigurationManager().getLootTable(loottableid).getEntries().add(loottable);
}
Also used : ISoliniaLootTableEntry(com.solinia.solinia.Interfaces.ISoliniaLootTableEntry) SoliniaLootTableEntry(com.solinia.solinia.Models.SoliniaLootTableEntry) ISoliniaLootTableEntry(com.solinia.solinia.Interfaces.ISoliniaLootTableEntry) ISoliniaLootTable(com.solinia.solinia.Interfaces.ISoliniaLootTable)

Aggregations

ISoliniaLootTable (com.solinia.solinia.Interfaces.ISoliniaLootTable)1 ISoliniaLootTableEntry (com.solinia.solinia.Interfaces.ISoliniaLootTableEntry)1 SoliniaLootTableEntry (com.solinia.solinia.Models.SoliniaLootTableEntry)1