-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTurnListener.java
More file actions
41 lines (36 loc) · 1.02 KB
/
TurnListener.java
File metadata and controls
41 lines (36 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package ca.bcit.comp2526.a2a;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
/**
* Mouse-click dependent subtype action listener
* that invokes a turn, effectively altering
* the World-GUI and its inhabitants.
*
* @author Kevin Oane
* @version 1.
*
*/
public class TurnListener extends MouseAdapter {
private GameFrame gameframe;
/**
* Create a TurnListener listening
* to a GameFrame object (GUI).
* @param gameframe
* Represents GameFrame hosting
* the cells and its entities
* in World.
*/
public TurnListener(final GameFrame gameframe) {
this.gameframe = gameframe;
}
/**
* Calls takeTurn (at GameFrame in World) when mouse
* is clicked.
* @param e
* Signals a MouseEvent
*/
public void mouseClicked(MouseEvent e) {
System.out.println("CLICK");
gameframe.takeTurn();
}
}