i'm having a syntax error when trying to use switch condition:
control cannot fall through from one case label to another...
my code is
public override Boolean intersect(Shape s)
{
switch (s.GetType().Name)
{
case "RealPoint":
{
s = (RealPoint)s;
if (!(this.gspos > s.gspos) && !(this.gspos < s.gspos))
return true;
}
case "Segment":
{
Size tsize;
tsize = s.gspos - this.gspos;
s = (Segment)s;
if (tsize.gsy == 0 && this.gspos.pgsx >= s.gspos.pgsx && this.gspos.pgsx <= (s.gspos.pgsx + s.gsize.gsx))
return true;
}
}
return false;
}
how can i fix ?