extends Resource

class_name Hole

var hole_id: int
var vectors: PackedVector2Array # verticies
var area: float


func _init(hole_id: int, vectors: PackedVector2Array):
	self.hole_id = hole_id
	self.vectors = vectors
	
	self.area = UTIL.get_polygon_area(self.vectors)

func center():
	var avg_vert = Vector2.ZERO
	
	for v in vectors:
		avg_vert += v
	
	return avg_vert / len(vectors)
