forked from dm94/DmPlugin
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dm94:master' into master
- Loading branch information
Showing
9 changed files
with
124 additions
and
14 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
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
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
34 changes: 34 additions & 0 deletions
34
src/main/java/com/deeme/behaviours/bestformation/FormationSupplier.java
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.deeme.behaviours.bestformation; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import eu.darkbot.api.config.annotations.Dropdown; | ||
import eu.darkbot.api.game.items.SelectableItem; | ||
import eu.darkbot.api.game.items.SelectableItem.Formation; | ||
|
||
public class FormationSupplier implements Dropdown.Options<String> { | ||
private static ArrayList<String> allItemsIds = new ArrayList<>(); | ||
|
||
@Override | ||
public List<String> options() { | ||
if (allItemsIds.isEmpty()) { | ||
Formation[] selectableItemList = SelectableItem.Formation.values(); | ||
for (Formation formation : selectableItemList) { | ||
allItemsIds.add(formation.getId()); | ||
} | ||
} | ||
return allItemsIds; | ||
} | ||
|
||
@Override | ||
public String getText(String id) { | ||
Formation[] selectableItemList = SelectableItem.Formation.values(); | ||
for (Formation formation : selectableItemList) { | ||
if (formation.getId().equals(id)) { | ||
return formation.name(); | ||
} | ||
} | ||
return id; | ||
} | ||
} |
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
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
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
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
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