How to make unit behavior ?

I am making 3D RTS and trying to make Pawn behavior, but I can’t occurred to come up with How to write program.

This behavior is that Pawn recognize a room that was made by player

What should I think to write program ?