RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
CircleArea.java
1package com.osroyale.game.world.position.impl;
2
3import com.osroyale.game.world.position.Area;
4import com.osroyale.game.world.position.Position;
5
41
42public class CircleArea extends Area {
43
44 private final String name;
45
46 private final int x;
47
48 private final int y;
49
50 private final int z;
51
52 private final int radius;
53
54 public CircleArea(String name, int x, int y, int radius) {
55 this(name, x, y, 0, radius);
56 }
57
58 public CircleArea(String name, int x, int y, int height, int radius) {
59 this.name = name;
60 this.x = x;
61 this.y = y;
62 this.z = height;
63 this.radius = radius;
64 }
65
66 public int getHeight() {
67 return z;
68 }
69
70 public String getName() {
71 return name;
72 }
73
74 public int getRadius() {
75 return radius;
76 }
77
78 public int getX() {
79 return x;
80 }
81
82 public int getY() {
83 return y;
84 }
85
86 @Override
87 public boolean inArea(Position position) {
88 if (position.getHeight() != z) {
89 return false;
90 }
91 return Math.pow((position.getX() - x), 2) + Math.pow((position.getY() - y), 2) <= Math.pow(radius, 2);
92 }
93
94 @Override
95 public Position getRandomLocation() {
96 return null;
97 }
98
99}