public ScanResult scan ( Robot robot , int dist ) { Point space = getReferenceField ( robot , dist ) ; Robot inPosition = getRobotAt ( space ) ; ScanResult ret = null ; if ( inPosition == null ) { ret = new ScanResult ( Found . EMPTY , dist ) ; } else { if ( robot . getData ( ) . getTeamId ( ) == inPosition . getData ( ) . getTeamId ( ) ) { ret = new ScanResult ( Found . FRIEND , dist ) ; } else { ret = new ScanResult ( Found . ENEMY , dist ) ; } } return ret ; }
Scans up to a number of fields in front of the robot stopping on the first field that contains a robot