diff --git a/src/main/java/cactusServer/entities/Area.java b/src/main/java/cactusServer/entities/Area.java new file mode 100644 index 0000000..5050012 --- /dev/null +++ b/src/main/java/cactusServer/entities/Area.java @@ -0,0 +1,43 @@ +package cactusServer.entities; + +import java.util.HashSet; + +public class Area { + private String name; + private Plain[] region; // �C�ӌ‚̕��ʂ̕����� + private HashSet permissions; // �G���A���ʼn”\�Ȃ��Ƃ̗��� + + public Area(String name, Plain[] regions, HashSet permissions) { + this.name = name; + this.region = regions; + this.permissions = permissions; + } + + public String getName() { + return name; + } + + public Plain[] getRegions() { + return region; + } + + public Plain getRegion(int index) { + return region[index]; + } + + public boolean isPermission(Allowed allowed) { + return permissions.contains(allowed); + } + + public void setPermission(Allowed allowed) { + permissions.add(allowed); + } + + public void removePermission(Allowed allowed) { + permissions.remove(allowed); + } + + public static enum Allowed { + SHOOT, KILL; + } +}