]> rtime.felk.cvut.cz Git - hubacji1/psp.git/blobdiff - api/psp.h
Move collide functions to `bcar` lib
[hubacji1/psp.git] / api / psp.h
index 38b4d49eb959e565754757465309cac159656741..752811fd97aa03b9690adda54f5de937b692faa1 100644 (file)
--- a/api/psp.h
+++ b/api/psp.h
@@ -1,6 +1,9 @@
 #ifndef PSP_H
 #define PSP_H
 
+#include <tuple>
+#include <vector>
+
 #include "bcar.h"
 #include "pslot.h"
 
@@ -15,7 +18,44 @@ class PSPlanner {
                 BicycleCar cc_;
                 BicycleCar gc_;
                 ParkingSlot ps_;
+
+                // find entry to slot by reverse approach
+                void fe_parallel();
+                void fe_perpendicular();
+                void fer_parallel();
+                void fer_perpendicular();
         public:
+                /*! \brief Return `true` if there is collision.
+
+                If the parking slot `ps` collide with current car `cc`,
+                return `true`.
+
+                This method depends on `intersection` function that
+                returns `true` or `false` if two line segments collide.
+                Each line segment of current car `cc` (borders) is
+                checked to each line segment of parking slot `ps`
+                (parking slot lines).
+                */
+                bool collide();
+                /*! \brief Return parking direction
+
+                Return `true` if the direction of the parking in the
+                slot is forward.
+                */
+                bool forward();
+                /*! \brief Has current car `cc` left?
+
+                Return `true` if the current car `cc` left the parking
+                slot `ps`;
+                */
+                bool left();
+                /*! \brief Is the goal car `gc` parked?
+
+                Return `true` if the goal car `gc` is inside the
+                parking slot `ps`.
+                */
+                bool parked();
+
                 // find entry
                 /*! \brief Find entry to the parking slot.
                 */