+
+void Pump::get_in_logic_connect_position(int& _a, int& _b)
+{
+ _a = in_x;
+ _b = in_y;
+}
+
+void Pump::get_out_logic_connect_position(int& _a, int& _b)
+{
+ _a = out_x;
+ _b = out_y;
+}
+
+ConnectorType Pump::detect_click_position(int _a, int _b)
+{
+ switch (imgActual) {
+ case 0:
+ if ( (_a <=image->get_width())&&(_a>=image->get_width()-32)&&(_b<=16)&&(_b >= 0) )
+ return IN;
+ if ( (_a <= image->get_width())&&(_a>=image->get_width()-32)&&(_b<=32)&&(_b > 16) )
+ return OUT;
+ break;
+ case 1:
+ if ( (_a <= 32)&&(_a>=0)&&(_b<=16)&&(_b >= 0) )
+ return IN;
+ if ( (_a <= 32)&&(_a>=0)&&(_b<=32)&&(_b > 16) )
+ return OUT;
+ }
+ return UNDEF;
+}
+
+void Pump::update_logic_position()
+{
+ switch (imgActual) {
+ case 1:
+ in_x = x + 16;
+ in_y = y;
+ out_x = in_x;
+ out_y = y + 32;
+ break;
+ case 0:
+ in_x = x + image->get_width()-16;
+ in_y = y;
+ out_x = in_x;
+ out_y = y + 32;
+ }
+}