Skip to content

Commit b436b9d

Browse files
committed
Implement match logic
1 parent 08fb4bf commit b436b9d

File tree

24 files changed

+1858
-0
lines changed

24 files changed

+1858
-0
lines changed

common/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>ru.croccode.hypernull</groupId>
8+
<artifactId>hypernull</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
</parent>
11+
<artifactId>common</artifactId>
12+
<version>1.0-SNAPSHOT</version>
13+
</project>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package ru.croccode.hypernull.domain;
2+
3+
import java.util.List;
4+
5+
import ru.croccode.hypernull.geometry.Point;
6+
import ru.croccode.hypernull.geometry.Size;
7+
8+
public interface MatchMap {
9+
10+
int DEFAULT_VIEW_RADIUS = 16;
11+
int DEFAULT_MINING_RADIUS = 3;
12+
int DEFAULT_ATTACK_RADIUS = 5;
13+
14+
Size getSize();
15+
16+
default int getWidth() {
17+
return getSize().width();
18+
}
19+
20+
default int getHeight() {
21+
return getSize().height();
22+
}
23+
24+
boolean isBlocked(Point point);
25+
26+
default boolean isBlocked(int x, int y) {
27+
return isBlocked(new Point(x, y));
28+
}
29+
30+
default int getViewRadius() {
31+
return DEFAULT_VIEW_RADIUS;
32+
}
33+
34+
default int getMiningRadius() {
35+
return DEFAULT_MINING_RADIUS;
36+
}
37+
38+
default int getAttackRadius() {
39+
return DEFAULT_ATTACK_RADIUS;
40+
}
41+
42+
List<Point> getSpawnPoints();
43+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package ru.croccode.hypernull.domain;
2+
3+
public enum MatchMode {
4+
FRIENDLY,
5+
DEATHMATCH;
6+
}

0 commit comments

Comments
 (0)