I'm working on a turn based game in Unity. I need to perform field/grid analysis(2D grid) when i'm iterating trough each unit "entity". The A.I. should be able to plan ahead and therefor needs to consider the components each unit have. Not every unit will have the same ability. These abilities are defined as components.
I want to make it flexible in the sense that I can plug in new abilities and my A.I. will take it into consideration.
While user control is somewhat implemented, A.I. hasn't even been written. So I'm open to any suggestion.
Q : What is a way for the A.I. system to collect all abilities of one unit and make decisions depending on each component?
edit: I know there is the "null" checking method to see if the gameobject contains a component. But this is highly inflexible because you are hard coding a stack of if else. Something I want to prevent.