First off O() notation is always worst-case so that part is redundant.is_registered_for_construction() → boolean
Is this entity or tile ghost or item request proxy registered for construction? If false, it means a construction robot has been dispatched to build the entity, or it is not an entity that can be constructed.
is_registered_for_deconstruction(force) → boolean
Is this entity registered for deconstruction with this force? If false, it means a construction robot has been dispatched to deconstruct it, or it is not marked for deconstruction. This is worst-case O(N) complexity where N is the current number of things in the deconstruct queue.
Parameters
force :: ForceIdentification: The force construction manager to check.
is_registered_for_upgrade() → boolean
Is this entity registered for upgrade? If false, it means a construction robot has been dispatched to upgrade it, or it is not marked for upgrade. This is worst-case O(N) complexity where N is the current number of things in the upgrade queue.
is_registered_for_repair() → boolean
Is this entity registered for repair? If false, it means a construction robot has been dispatched to upgrade it, or it is not damaged. This is worst-case O(N) complexity where N is the current number of things in the repair queue.
How come is_registered_for_construction does not take O(N) while all the others do? Is that an oversight?
I'm afraid of using these methods because with for example 10k deconstruction markers the worst-case would really sucks making my mod unusable. When is it not the worst case? What is a good case? Are entities listed per chunk so the worst case is only when all marked entities are in the same chunk? What is the deal there?
Unless the worst-case is really unlikely those methods would be useless and I can't believe there isn't a better method to check this. What do you do when an entity is mined, revived or deconstruction/upgrade canceled? I can't believe canceling deconstruction on entities would be O(n) as that would freeze the game for extended periods. I've marked and undone harvesting big forests and the game didn't freeze. I've placed and undone blueprints with 100k landfill before and the game didn't take longer to undo than do, certainly not 100000 times as long. Whatever method is used to quickly remove entities from lists should also be used to just check if they are in the list.
PS: I really just want to know if a bot is scheduled for a ghost or deconstruction. Knowing if it's a personal bot or not or how far away / where the bot is would be an added bonus.