短小代码求优化。标题要长。。。。。。。。。。。
程序代码:
if (this.CurPos.X < this.MoveField.left) { this.CurPos.X = this.MoveField.left; } if (this.CurPos.X > this.MoveField.right) { this.CurPos.X = this.MoveField.left; } if (this.CurPos.Y < this.MoveField.top) { this.CurPos.Y = this.MoveField.top; } if (this.CurPos.Y > this.MoveField.buttom) { this.CurPos.Y = this.MoveField.buttom; } 求优化。这些代码看得闹心,您呢?