How to integrate unreal engine with logic written in cpp

Hello,

I would like to use unreal engine as graphical UI to the game written in pure c++ (all the logic). This is my first project in UE and I am confused. So far I have noticed that engine requires its classes as parent one.
The problem is that I don’t want to change the already written code.

Early I through about invoking events in code to perform actions in unreal. (Like adding additional class which would listen to stage of game and raised events when specific conditions would be fulfilled )

Is there a possibility which I so far could not see ? :wink: