private static ActionDef CreateDef(params string[] keyValues) { var result = new ActionDef(); for (int i = 0; i < keyValues.Length; i += 2) { result.Add(keyValues[i]?.ToString(), keyValues[i + 1]); } return(result); }
private static ActionDef AddDefAction(ActionDef a, ActionDef defValues) { a = new ActionDef(a); if (defValues == null) { return(a); } foreach (var e in defValues) { if (!a.ContainsKey(e.Key)) { a.Add(e.Key, e.Value); } } if (!a.ContainsKey("phase")) { a.Add("phase", DEFAULT_PHASE_LOWER); } else { a["phase"] = a["phase"].ToString().Trim().ToLowerInvariant(); } return(a); }
private static ActionDef AddDefAction(ActionDef a, ActionDef defValues) { a = new ActionDef(a); if (defValues == null) { return(a); } foreach (var e in defValues) { if (!a.ContainsKey(e.Key)) { a.Add(e.Key, e.Value); } } return(a); }