How should I code units in an RTS game?

Did this ever work for you?