Okay so I've tried a few methods already, as I am coding custom skills for my project and I'm quite in a pit where I can't seem to come up with a solution to ease the performance used to just return the values.
The original code which took too much is by using these:
All coordinates from 000 - 999 both X and Y in dictionary loaded from start of server.
Calculating a cone;
Using ConcurrentDictionary
and filter down with the Math of the cone
Lastly I fill the new ConcDictionary with the coordinates that is correct.
Once it gets to the last coordinate, example 682, then it will automatically break on Y.
However because of this, it has still looped from 000 all way to 600 skipping coordinates and just unnesecary use of computer resources.
So, I'll let you guys state your opinions, pretty sure you guys can come up with something much better. but remember, I need it to return the X,Y value of everything within a cone/circle or any sort depending on the math.
The original code which took too much is by using these:
All coordinates from 000 - 999 both X and Y in dictionary loaded from start of server.
Calculating a cone;
Using ConcurrentDictionary
and filter down with the Math of the cone
Lastly I fill the new ConcDictionary with the coordinates that is correct.
Once it gets to the last coordinate, example 682, then it will automatically break on Y.
However because of this, it has still looped from 000 all way to 600 skipping coordinates and just unnesecary use of computer resources.
Code:
Original: Coordinates as Entity //Needs replacement