public void BuildActionsEffectsTable() { //Go through every effect and add all the actions that have this effect to the effectsTable for (E_GOAPAction i = 0; i < E_GOAPAction.Count; i++) { GOAPAction action = Ai.GetAction(i); if (action == null) { continue; } //go through all world effects for (uint j = 0; j < (int)E_PropKey.Count; j++) { if (m_EffectsTable[j] == null) { m_EffectsTable[j] = new List <GOAPAction>(); } if (action.WorldEffects.IsWSPropertySet((E_PropKey)j)) // if set { m_EffectsTable[j].Add(action); // store it } } } }