summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view/IClickable.java
blob: c8270420d3350a02f98a33ecf8a3df49c2cc4de2 (plain)
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
package jrummikub.view;

import jrummikub.model.Position;
import jrummikub.util.IEvent2;

/**
 * An interface for view elements that can emit click events
 */
public interface IClickable {
  /**
   * the click event is emitted when the player clicks on the table/board/etc.
   * 
   * @return the event; the first parameter is the position of the click in grid
   *         coordinates, the second is true when the player wants to add stones
   *         to his selection instead of replacing them
   */
  public IEvent2<Position, Boolean> getClickEvent();

  /**
   * the range click event is emitted when the player clicks on the table/board/
   * etc. and wants to select a range instead of a single stone
   * 
   * @return the event; the first parameter is the position of the click in grid
   *         coordinates, the second is true when the player wants to add stones
   *         to his selection instead of replacing them
   */
  public IEvent2<Position, Boolean> getRangeClickEvent();

  /**
   * the set click event is emitted when the player clicks on the table/board/
   * etc. and wants to select a whole set instead of a single stone
   * 
   * @return the event; the first parameter is the position of the click in grid
   *         coordinates, the second is true when the player wants to add stones
   *         to his selection instead of replacing them
   */
  public IEvent2<Position, Boolean> getSetClickEvent();
}