@@ -22,14 +22,64 @@ public class DominationMap implements Iterable<Zone>{
22
22
private float gameDuration = 10F ;
23
23
private float showdownDuration = 3F ;
24
24
private boolean immortalCore = true ;
25
- private final ArrayList <Zone > zones = new ArrayList <>();
25
+ private final List <Zone > zones = new ArrayList <>();
26
26
27
27
private static final Seq <Effect > effects = Seq .with (Fx .mine , Fx .mineBig , Fx .mineHuge );
28
28
29
29
public void update (){
30
30
zones .forEach (z -> z .update (this ));
31
31
}
32
32
33
+ public float [] createZoneCircle (){
34
+ return Geometry .regPoly ((int )(Mathf .pi * zoneRadius ), zoneRadius );
35
+ }
36
+
37
+ public void drawZoneCircles (){
38
+ float [] circle = createZoneCircle ();
39
+
40
+ zones .forEach (z -> {
41
+ Geometry .iteratePolygon ((cx , cy ) -> {
42
+ Call .effect (effects .random (), (cx + z .getX ()) * Vars .tilesize , (cy + z .getY ()) * Vars .tilesize , 0 , z .getTeam ().color );
43
+ }, circle );
44
+ });
45
+ }
46
+
47
+ public void drawZoneCircles (NetConnection con ){
48
+ float [] circle = createZoneCircle ();
49
+
50
+ zones .forEach (z -> {
51
+ Geometry .iteratePolygon ((cx , cy ) -> {
52
+ Call .effect (con , effects .random (), (cx + z .getX ()) * Vars .tilesize , (cy + z .getY ()) * Vars .tilesize , 0 , z .getTeam ().color );
53
+ }, circle );
54
+ });
55
+ }
56
+
57
+ public void drawZoneCenters (){
58
+ zones .forEach (z -> {
59
+ Call .effect (Fx .unitLand , z .getX () * Vars .tilesize , z .getY () * Vars .tilesize , 0 , z .getTeam ().color );
60
+ });
61
+ }
62
+
63
+ public void drawZoneCenters (NetConnection con ){
64
+ zones .forEach (z -> {
65
+ Call .effect (con , Fx .unitLand , z .getX () * Vars .tilesize , z .getY () * Vars .tilesize , 0 , z .getTeam ().color );
66
+ });
67
+ }
68
+
69
+ public void drawZoneTexts (float lifetime ){
70
+ zones .forEach (z -> {
71
+ String percent = Strings .format ("[#@]@%" , z .getTeam ().color , Strings .fixed (z .getPercent (), 0 ));
72
+ Call .label (percent , lifetime , z .getX () * Vars .tilesize , z .getY () * Vars .tilesize );
73
+ });
74
+ }
75
+
76
+ public void drawZoneTexts (NetConnection con , float lifetime ){
77
+ zones .forEach (z -> {
78
+ String percent = Strings .format ("[#@]@%" , z .getTeam ().color , Strings .fixed (z .getPercent (), 0 ));
79
+ Call .label (con , percent , lifetime , z .getX () * Vars .tilesize , z .getY () * Vars .tilesize );
80
+ });
81
+ }
82
+
33
83
public int getZoneRadius (){
34
84
return zoneRadius ;
35
85
}
@@ -66,6 +116,15 @@ public void setGameDuration(float gameDuration){
66
116
this .gameDuration = gameDuration ;
67
117
}
68
118
119
+ public float getShowdownDuration (){
120
+ return showdownDuration ;
121
+ }
122
+
123
+ public void setShowdownDuration (float showdownDuration ){
124
+ if (showdownDuration < 0 ) throw new IllegalArgumentException ("The showdown duration is negative: " + showdownDuration );
125
+ this .showdownDuration = showdownDuration ;
126
+ }
127
+
69
128
public boolean hasImmortalCore (){
70
129
return immortalCore ;
71
130
}
@@ -105,65 +164,6 @@ public Zone getZone(int x, int y){
105
164
return null ;
106
165
}
107
166
108
- public float getShowdownDuration (){
109
- return showdownDuration ;
110
- }
111
-
112
- public void setShowdownDuration (float showdownDuration ){
113
- if (showdownDuration < 0 ) throw new IllegalArgumentException ("The showdown duration is negative: " + showdownDuration );
114
- this .showdownDuration = showdownDuration ;
115
- }
116
-
117
- public void drawZoneCircles (){
118
- float [] circle = createZoneCircle ();
119
-
120
- zones .forEach (z -> {
121
- Geometry .iteratePolygon ((cx , cy ) -> {
122
- Call .effect (effects .random (), (cx + z .getX ()) * Vars .tilesize , (cy + z .getY ()) * Vars .tilesize , 0 , z .getTeam ().color );
123
- }, circle );
124
- });
125
- }
126
-
127
- public void drawZoneCircles (NetConnection con ){
128
- float [] circle = createZoneCircle ();
129
-
130
- zones .forEach (z -> {
131
- Geometry .iteratePolygon ((cx , cy ) -> {
132
- Call .effect (con , effects .random (), (cx + z .getX ()) * Vars .tilesize , (cy + z .getY ()) * Vars .tilesize , 0 , z .getTeam ().color );
133
- }, circle );
134
- });
135
- }
136
-
137
- public void drawZoneCenters (){
138
- zones .forEach (z -> {
139
- Call .effect (Fx .unitLand , z .getX () * Vars .tilesize , z .getY () * Vars .tilesize , 0 , z .getTeam ().color );
140
- });
141
- }
142
-
143
- public void drawZoneCenters (NetConnection con ){
144
- zones .forEach (z -> {
145
- Call .effect (con , Fx .unitLand , z .getX () * Vars .tilesize , z .getY () * Vars .tilesize , 0 , z .getTeam ().color );
146
- });
147
- }
148
-
149
- public void drawZoneTexts (float lifetime ){
150
- zones .forEach (z -> {
151
- String percent = Strings .format ("[#@]@%" , z .getTeam ().color , Strings .fixed (z .getPercent (), 0 ));
152
- Call .label (percent , lifetime , z .getX () * Vars .tilesize , z .getY () * Vars .tilesize );
153
- });
154
- }
155
-
156
- public void drawZoneTexts (NetConnection con , float lifetime ){
157
- zones .forEach (z -> {
158
- String percent = Strings .format ("[#@]@%" , z .getTeam ().color , Strings .fixed (z .getPercent (), 0 ));
159
- Call .label (con , percent , lifetime , z .getX () * Vars .tilesize , z .getY () * Vars .tilesize );
160
- });
161
- }
162
-
163
- public float [] createZoneCircle (){
164
- return Geometry .regPoly ((int )(Mathf .pi * zoneRadius ), zoneRadius );
165
- }
166
-
167
167
@ Override
168
168
public Iterator <Zone > iterator (){
169
169
return zones .listIterator ();
0 commit comments