Converted foreach->for throughout.
Converted foreach->for throughout.

--- a/EVAManager.cs
+++ b/EVAManager.cs
@@ -49,7 +49,7 @@
 		private List<ConfigAction> evaConfigs;
 		private List<ConfigAction> passQueue;
 
-		private Part evaPart;
+		private List<Part> evaParts;
 
 		private Pass pass;
 
@@ -57,6 +57,7 @@
 		{
 			pass = Pass.Collect;
 			this.passQueue = new List<ConfigAction>();
+			this.evaParts = new List<Part>();
 		}
 
 		public virtual void Update()
@@ -77,16 +78,22 @@
 				this.passQueue.Clear();
 			}
 
+			ConfigAction action;
+
 			switch (pass)
 			{
 				case Pass.Collect:
-					foreach (var loadedPart in PartLoader.LoadedPartsList)
-					{
-						if (loadedPart.name.ToLower() == "kerbaleva")
+					AvailablePart loadedPart;
+					for (int idx = 0; idx < PartLoader.LoadedPartsList.Count; idx++)
+					{
+						loadedPart = PartLoader.LoadedPartsList[operatorIdx];
+						string lowerName = loadedPart.name.ToLower();
+
+						if (lowerName == "kerbaleva" || lowerName == "kerbalevafemale")
 						{
 							this.LogDebug("Found {0}", loadedPart.name);
 
-							evaPart = loadedPart.partPrefab;
+							evaParts.Add(loadedPart.partPrefab);
 
 							#if DEBUG
 							log = Tools.DebugLogger.New(this);
@@ -113,7 +120,10 @@
 							log.Print();
 							#endif
 
-							break;
+							if (this.evaParts.Count == 2)
+							{
+								break;
+							}
 						}
 					}
 
@@ -121,8 +131,11 @@
 
 					Regex rgx = new Regex(patchPattern);
 
-					foreach (var urlConfig in GameDatabase.Instance.root.AllConfigs)
-					{
+					UrlDir.UrlConfig urlConfig;
+					IEnumerator<UrlDir.UrlConfig> enumerator = GameDatabase.Instance.root.AllConfigs.GetEnumerator();
+					while (enumerator.MoveNext())
+					{
+						urlConfig = enumerator.Current;
 						Tools.PostDebugMessage(
 							this,
 							"Checking urlconfig; name: {0}, type: {1}, config.name: {2}",
@@ -155,8 +168,9 @@
 					pass = Pass.Delete;
 					break;
 				case Pass.Delete:
-					foreach (ConfigAction action in this.evaConfigs)
-					{
+					for (int idx = 0; idx < this.evaConfigs.Count; idx++)
+					{
+						action = this.evaConfigs[idx];
 						if (action.Operator == "DELETE")
 						{
 							this.LogDebug("Trying delete action on {0}", action);
@@ -170,10 +184,12 @@
 							switch (action.ClassType)
 							{
 								case MODULE:
-									this.delModuleByName(action.MatchName);
+									this.delModuleByName(evaParts[0], action.MatchName);
+									this.delModuleByName(evaParts[1], action.MatchName);
 									break;
 								case RESOURCE:
-									this.delResourceByName(action.MatchName);
+									this.delResourceByName(evaParts[0], action.MatchName);
+									this.delResourceByName(evaParts[1], action.MatchName);
 									break;
 								default:
 									this.LogWarning("Class type '{0}' not implemented for 'delete' action.",
@@ -186,8 +202,9 @@
 					pass = Pass.Edit;
 					break;
 				case Pass.Edit:
-					foreach (ConfigAction action in this.evaConfigs)
-					{
+					for (int idx = 0; idx < this.evaConfigs.Count; idx++)
+					{
+						action = this.evaConfigs[idx];
 						if (action.Operator == "EDIT")
 						{
 							this.LogDebug("Trying edit action on {0}", action);
@@ -201,10 +218,12 @@
 							switch (action.ClassType)
 							{
 								case MODULE:
-									this.editModuleByNameFromConfig(action.MatchName, action.Node);
+									this.editModuleByNameFromConfig(evaParts[0], action.MatchName, action.Node);
+									this.editModuleByNameFromConfig(evaParts[1], action.MatchName, action.Node);
 									break;
 								case RESOURCE:
-									this.editResourceByNameFromConfig(action.MatchName, action.Node);
+									this.editResourceByNameFromConfig(evaParts[0], action.MatchName, action.Node);
+									this.editResourceByNameFromConfig(evaParts[1], action.MatchName, action.Node);
 									break;
 								default:
 									this.LogWarning("Class type '{0}' not implemented for 'delete' action.",
@@ -216,8 +235,9 @@
 					pass = Pass.Insert;
 					break;
 				case Pass.Insert:
-					foreach (ConfigAction action in this.evaConfigs)
-					{
+					for (int idx = 0; idx < this.evaConfigs.Count; idx++)
+					{
+						action = this.evaConfigs[idx];
 						if (action.Operator == empty)
 						{
 							if (action.MatchName != string.Empty)
@@ -229,10 +249,12 @@
 							switch (action.ClassType)
 							{
 								case MODULE:
-									this.addModuleFromConfig(action.Node);
+									this.addModuleFromConfig(evaParts[0], action.Node);
+									this.addModuleFromConfig(evaParts[1], action.Node);
 									break;
 								case RESOURCE:
-									this.addResourceFromConfig(action.Node);
+									this.addResourceFromConfig(evaParts[0], action.Node);
+									this.addResourceFromConfig(evaParts[1], action.Node);
 									break;
 								default:
 									this.LogWarning("Class type '{0}' not implemented for 'add' action.",
@@ -276,7 +298,7 @@
 			}
 		}
 
-		private void addModuleFromConfig(ConfigNode evaModuleNode)
+		private void addModuleFromConfig(Part evaPart, ConfigNode evaModuleNode)
 		{
 			string moduleName;
 
@@ -335,7 +357,7 @@
 			}
 		}
 
-		private void addResourceFromConfig(ConfigNode evaResourceNode)
+		private void addResourceFromConfig(Part evaPart, ConfigNode evaResourceNode)
 		{
 			string resourceName;
 
@@ -382,9 +404,9 @@
 			}
 		}
 
-		private void delModuleByName(string matchName)
-		{
-			PartModule module = this.matchFirstModuleByName(matchName);
+		private void delModuleByName(Part evaPart, string matchName)
+		{
+			PartModule module = this.matchFirstModuleByName(evaPart, matchName);
 
 			if (module != null)
 			{
@@ -392,9 +414,9 @@
 			}
 		}
 
-		private void delResourceByName(string matchName)
-		{
-			PartResource resource = this.matchFirstResourceByName(matchName);
+		private void delResourceByName(Part evaPart, string matchName)
+		{
+			PartResource resource = this.matchFirstResourceByName(evaPart, matchName);
 
 			if (resource != null)
 			{
@@ -407,9 +429,9 @@
 			}
 		}
 
-		private void editModuleByNameFromConfig(string matchName, ConfigNode config)
-		{
-			PartModule module = this.matchFirstModuleByName(matchName);
+		private void editModuleByNameFromConfig(Part evaPart, string matchName, ConfigNode config)
+		{
+			PartModule module = this.matchFirstModuleByName(evaPart, matchName);
 
 			if (module != null)
 			{
@@ -439,9 +461,9 @@
 			}
 		}
 
-		private void editResourceByNameFromConfig(string matchName, ConfigNode config)
-		{
-			PartResource resource = this.matchFirstResourceByName(matchName);
+		private void editResourceByNameFromConfig(Part evaPart, string matchName, ConfigNode config)
+		{
+			PartResource resource = this.matchFirstResourceByName(evaPart, matchName);
 
 			if (resource != null)
 			{
@@ -471,12 +493,15 @@
 			}
 		}
 
-		private PartModule matchFirstModuleByName(string matchName)
+		private PartModule matchFirstModuleByName(Part evaPart, string matchName)
 		{
 			Regex rgx = new Regex(@matchName);
 
-			foreach (PartModule module in evaPart.GetComponents<PartModule>())
-			{
+			PartModule[] modules = evaPart.GetComponents<PartModule>();
+			PartModule module;
+			for (int idx = 0; idx < modules.Length; idx++)
+			{
+				module = modules[idx];
 				Match match = rgx.Match(module.GetType().Name);
 
 				if (match.Success)
@@ -488,12 +513,15 @@
 			return null;
 		}
 
-		private PartResource matchFirstResourceByName(string matchName)
+		private PartResource matchFirstResourceByName(Part evaPart, string matchName)
 		{
 			Regex rgx = new Regex(@matchName);
 
-			foreach (PartResource resource in evaPart.GetComponents<PartResource>())
-			{
+			PartResource[] resources = evaPart.GetComponents<PartResource>();
+			PartResource resource;
+			for (int idx = 0; idx < resources.Length; idx++)
+			{
+				resource = resources[idx];
 				Match match = rgx.Match(resource.resourceName);
 
 				Tools.PostDebugMessage(
@@ -515,8 +543,10 @@
 		{
 			bool success = true;
 
-			foreach (ConfigNode.Value cfgValue in config.values)
-			{
+			ConfigNode.Value cfgValue;
+			for (int idx = 0; idx < config.values.Count; idx++)
+			{
+				cfgValue = config.values[idx];
 				try
 				{
 					var namedField = obj.GetType().GetField(cfgValue.name,
@@ -565,8 +595,10 @@
 
 		private ConfigNode mergeConfigs(ConfigNode source, ConfigNode target)
 		{
-			foreach (ConfigNode.Value value in target.values)
-			{
+			ConfigNode.Value value;
+			for (int idx = 0; idx < target.values.Count; idx++)
+			{
+				value = target.values[idx];
 				if (source.HasValue(value.name))
 				{
 					source.RemoveValue(value.name);
@@ -600,14 +632,22 @@
 
 			source.AddValue("name", module.GetType().Name);
 
-			foreach (var field in module.GetType().GetFields(
+			System.Reflection.FieldInfo[] fieldInfos = module.GetType().GetFields(
 				System.Reflection.BindingFlags.Public |
 				System.Reflection.BindingFlags.NonPublic |
 				System.Reflection.BindingFlags.Instance
-			))
-			{
-				foreach (object attr in field.GetCustomAttributes(true))
-				{
+			);
+			System.Reflection.FieldInfo field;
+			for (int fIdx = 0; fIdx < fieldInfos.Length; fIdx++)
+			{
+				field = fieldInfos[fIdx];
+
+				object[] attrs = field.GetCustomAttributes(true);
+				object attr;
+				for (int aIdx = 0; aIdx < attrs.Length; aIdx++)
+				{
+					attr = attrs[aIdx];
+
 					if (attr is KSPField)
 					{
 						source.AddValue(field.Name, field.GetValue(module));