Newer
Older
CactusServer / src / main / java / cactusServer / entities / Area.java
package cactusServer.entities;

import java.util.HashSet;

public class Area {
	private String name;
	private Plain[] region; // 任意個の平面の方程式
	private HashSet<Allowed> permissions; // エリア内で可能なことの羅列
	
	public Area(String name, Plain[] regions, HashSet<Allowed> 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);
	}
}