Skip to content

Instantly share code, notes, and snippets.

@marshall007
Created August 30, 2011 02:34
Show Gist options
  • Save marshall007/1180027 to your computer and use it in GitHub Desktop.
Save marshall007/1180027 to your computer and use it in GitHub Desktop.
Loading the decks
public void load() {
Configuration deckConfig = new Configuration(new File(plugin.dir + "decks.yml"));
deckConfig.load();
LinkedList<Card> savedDeck = null;
int s, r;
LinkedList<String> deck = (LinkedList) deckConfig.getStringList("decks." + deckName, null);
for (int i=0; i<deck.size(); i++) {
String[] temp = deck.get(i).split("-");
s = Integer.parseInt(temp[0]);
r = Integer.parseInt(temp[1]);
savedDeck.push(new Card(s, r));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment