Answer the question
In order to leave comments, you need to log in
What is the best way to store data for a point on a plane?
There is a way - an array of points on the plane.
There are walls. It is necessary to check that the waypoints do not cross the walls.
Walls are dots.
(x, y)
What is the best way to store wall points?
Dictionary<string, bool> wall =
new Dictionary<string, bool>();
wall['1_1']=true;
if (!wall.ContainsKey("1_1"))
{
// стена !!
}
Answer the question
In order to leave comments, you need to log in
The path is the stack.
Walls are dots?! Maybe segments connected by dots?!
Walls=segments - it is better to store in the structural array "walls": x0,y0 and x1,y1 (coordinates of the beginning and end of the segment)
In order not to intersect - the formula for the intersection of two lines from geometry.
Store everything in vectors. In principle, a point is a vector with zero length (mathematicians will beat me, and the dog is with them). Well, then look for intersections :)
There are walls. It is necessary to check that the waypoints do not cross the walls.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question