Trigger an action when a map is empty

Hi all,

Looking for a way to trigger an action when a map has no more unit, no more cards on it.
I know how the inventory works to calculate and add up units, but how can this be used to trigger an event ?
Like : end of turn, end of game …