For my college we are doing a research on a "Navigation Controller", part of this is that we must create a library(API?)/plugin for a program that is protected.
Lets say this program is a "Navigation Controller" for cars, so the program can make a navigation mesh of the road the car is about to drive and it calculates where on the road it should drive and when a turn is incoming it calculates if you should brake and take the outside or inside of the turn...
Now we need to make an API or Library or Adapter Pattern (?) for this Navigation Controller. Navigation Controller's algorithms should be hidden inside the file, it is not Open-Source. It is written in C++.
Any programmer that is making a game, lets say "Car Simulator" (instead of Flight Simulator), want's an option in their game that you can put the car on "Auto Pilot", wants this Plugin, the Navigation Plugin...
The programmer should be able to "include" our plugin/library/API and use our functions, such as
int CalculateSteeringAxis(Pos currentPosition, Goal currentGoal)
He should not be able to see our code/algorithms. Any game should be able to "include" our plugin, so our plugin is a standalone generic plugin..
I found ways like "Adapter patterns/Wrapper" / "Win32 API" / "Decorators". What might be the best solution for this problem?
You can compile your codes to a dynamic library(called "dll" under Windows, or "so" under Linux), or static library.
Then release the library to other programmers, they can link the library for their games.
As the library was compile to binary, others cannot see your source codes and algorithms.