- Apply their damage after ships and fighters (and planets), so they can be shot down before they hit anything.
- Self-destruct on successful hit.
There's a lot of files and stuff to be changed but most of what must be done seems obvious, but my ignorance about C++ makes some parts rather obcure to me. My C++ knowledge reduces to the basic concepts of OOP and some spare coding before 2000. There're some pieces of code that I have no clue what they could do (I mean the general syntax like the constructors' or those <name>::<name>::<name> I see everywhere).
My first serious doubt:
How to differentiate between missiles and fighters in std::string FighterOrPublicNameLink
https://github.com/freeorion/freeorion/ ... #L102-L109
Code: Select all
/// Creates a link tag of the appropriate type for either a fighter or another object.
std::string FighterOrPublicNameLink(
int viewing_empire_id, int object_id, int object_empire_id) {
if (object_id >= 0) // ship
return PublicNameLink(viewing_empire_id, object_id);
else // fighter
return EmpireColorWrappedText(object_empire_id, UserString("OBJ_FIGHTER"));
}
Code: Select all
return EmpireColorWrappedText(object_empire_id, UserString("OBJ_MISSILE"));
How can I check the type of the object from its object_id?
Or what should I be passing to FighterOrPublicNameLink() (from the multiple places it's called) instead of object_id to have access to the object type/class?