當我嘗試使用自動格式化時,評論無法正常使用。這是代碼之前,我用自動格式化:在同一行上自動格式化評論
if (x > 125 && x < 295 && y > 180 && y < 350) { //if mouse in first tower
if (x > bar1.x1 && x < bar1.x2 && y > bar1.y1 && y < bar1.y2){ //if mouse in first bar
}
if (x > bar2.x1 && x < bar2.x2 && y > bar2.y1 && y < bar2.y2){ //if mouse in second bar
}
if (x > bar3.x1 && x < bar3.x2 && y > bar3.y1 && y < bar3.y2){ //if mouse in third bar
}
if (x > bar4.x1 && x < bar4.x2 && y > bar4.y1 && y < bar4.y2){ //if mouse in fourth bar
}
if (x > bar5.x1 && x < bar5.x2 && y > bar5.y1 && y < bar5.y2){ //if mouse in fifth bar
}
}
這是我使用自動格式化後的代碼:
if (x > 125 && x < 295 && y > 180 && y < 350) { // if mouse in first
// tower
if (x > bar1.x1 && x < bar1.x2 && y > bar1.y1 && y < bar1.y2) { // if
// mouse
// in
// first
// bar
}
if (x > bar2.x1 && x < bar2.x2 && y > bar2.y1 && y < bar2.y2) { // if
// mouse
// in
// second
// bar
}
if (x > bar3.x1 && x < bar3.x2 && y > bar3.y1 && y < bar3.y2) { // if
// mouse
// in
// third
// bar
}
if (x > bar4.x1 && x < bar4.x2 && y > bar4.y1 && y < bar4.y2) { // if
// mouse
// in
// fourth
// bar
}
if (x > bar5.x1 && x < bar5.x2 && y > bar5.y1 && y < bar5.y2) { // if
// mouse
// in
// fifth
// bar
}
}
我該如何解決這個問題?
您使用哪個IDE? – tomse 2015-04-01 19:31:39