So, I am currently struggling with the following problem:
I created myself a library function to check for engines that have a flameout, which looks like this (c#):
public static bool ActiveEngineFlameout(Vessel vessel)
{
return vessel.Parts.Engines.Where(e => (e.Active && !e.HasFuel)).Count() > 0;
}
Now, since I am running on rss, I have to have ullage motors on my rockets to get stable fuel flow, and that makes it really hard to use this logic to check if staging is necessary, since I dont want to stage when there is an active ullage motor without fuel.
Now I could simply check if the Engine happens to be a "baby sergeant rocket motor", which I use for ullage in this case, but then the function will be defunctional if I use said engines in an actual stage, eg a satellite. I could also write a specific version for this function for every stage, but that would not result in very nice code.
Does anyone have a suggestion on how to make a nice implementation for this? I was thinking of something along the lines of giving parts the ability to have a custom tag, flag or name (as in KOS), and being able to check for that in the part api, so that in this case I could say something along the lines of:
(e.Active && !e.HasFuel && !e.HasTag("NoFlameoutCheck"))
Any other suggestions on how I can nicely implement this?