Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void actionPerformed(ActionEvent e) {
- String cmd = e.getActionCommand();
- String name;
- code...
- if(cmd.equals("Play")) {
- name = field.getText();
- card = getCard(name);
- if(card != null) {
- if(rules.zoneHasCard(card, rules.hand)) {
- display.updateStatusMessage(rules.play(card));
- field.setText("");
- display.updateHand(rules.zoneList("hand"));
- display.updateDiscard(rules.zoneList("Discard")); // This is the error here! The discard Zone was empty!
- }
- else {
- field.setText("You do not have " + card.getName());
- field.selectAll();
- }
- }
- else {
- field.setText("That cardname is unused");
- field.selectAll();
- }
- }
- }
- public void actionPerformed(ActionEvent e) {
- String cmd = e.getActionCommand();
- String name;
- // more code...
- }
- System.out.println("field = " + field);
- System.out.println("rules = " + rules);
- System.out.println("display = " + display);
Add Comment
Please, Sign In to add comment