Now I have a lot of airplanes, in the ideal world
the interface of the airplanes(or anything) should be unify
but for some kind of weird reasons, the class for different airplanes
are designed like this
struct airplane_A
{
fly_A();
speed_up_A();
//blah blah blah
};
struct airplane_B
{
fly_B();
speed_up_B();
//blah blah blah
};
Actually, the interfaces could be unified, but what is done is done.
There are already more than 30 airplanes are designed like this
If the interfaces of these airplanes are unify
We don't need to write a lot of redundancy codes
It could be solved by template or virtual
But now I don't have a good way to solve this kind of problem
except of writing a simple program to generate codes for me.
I try to use wrapper to wrap those interfaces, but it is impractical
since I have to design many wrappers for different airplane(macro is hard to debug)
This design just like
vector<int> A;
vector<double> B;
A.push_back_int(3);
B.push_back_double(4.0);
//etc
I don't know how to fix it, really
Thanks for your help