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 package com.buckosoft.fibs.BuckoFIBS.gui.boardTab.boardPane;
36
37 import java.awt.Point;
38
39 import com.buckosoft.fibs.BuckoFIBS.gui.boardTab.boardPane.BoardPane.BoardSpecs;
40 import com.buckosoft.fibs.domain.Board;
41
42
43
44
45
46
47
48 public abstract class AnimateEventDouble extends AnimateEvent {
49 protected BoardPane boardPane;
50 public BoardSpecs bs;
51
52
53 protected double x[] = new double[6];
54 protected double y[] = new double[6];
55
56 private int cubeBefore;
57 private int cubeAfter;
58 protected int whoDoubled;
59
60 abstract public void calculate(Board board);
61 abstract public int[] getXY(double offset);
62
63 @Override
64 public int getDuration() {
65 return 1500;
66 }
67
68 @Override
69 public Type getType() {
70 return Type.Double;
71 }
72
73 @Override
74 public boolean isGui() {
75 return false;
76 }
77
78 public void setBoardPane(BoardPane boardPane) {
79 this.boardPane = boardPane;
80 this.bs = boardPane.bs;
81 }
82
83
84
85
86 public void setWhoDoubled(int xo) {
87 this.whoDoubled = xo;
88 }
89
90
91
92
93 public int getWhoDoubled() {
94 return(this.whoDoubled);
95 }
96
97
98
99
100 public int getCubeBefore() {
101 return cubeBefore;
102 }
103
104
105
106
107 public void setCubeBefore(int cubeBefore) {
108 this.cubeBefore = cubeBefore;
109 this.cubeAfter = this.cubeBefore * 2;
110 if (this.cubeAfter > 64)
111 this.cubeAfter = 1;
112 }
113
114
115
116
117 public int getCubeAfter() {
118 return cubeAfter;
119 }
120
121 protected Point getDoubleCubeXY() {
122 return(boardPane.getDoubleCubeXY());
123 }
124 protected int getDoubleCubeWidth() {
125 return(boardPane.getDoubleCubeWidth());
126 }
127 protected int getPointX(int point) {
128 return(boardPane.getPointX(point));
129 }
130 protected int getNthCheckerY(int point, int checker) {
131 return(boardPane.getNthCheckerY(point, checker));
132 }
133 protected Point getDoubleCubePushXY() {
134 return(boardPane.getDoubleCubePushXY());
135 }
136
137 }