private void InitVerbs(Func <Type, string, Verb> creator) { List <VerbProperties> verbProperties = this.directOwner.VerbProperties; if (verbProperties != null) { for (int i = 0; i < verbProperties.Count; i++) { try { VerbProperties verbProperties2 = verbProperties[i]; string text = Verb.CalculateUniqueLoadID(this.directOwner, i); this.InitVerb(creator(verbProperties2.verbClass, text), verbProperties2, null, null, text); } catch (Exception ex) { Log.Error(string.Concat(new object[] { "Could not instantiate Verb (directOwner=", this.directOwner.ToStringSafe <IVerbOwner>(), "): ", ex }), false); } } } List <Tool> tools = this.directOwner.Tools; if (tools != null) { for (int j = 0; j < tools.Count; j++) { Tool tool = tools[j]; foreach (ManeuverDef current in tool.Maneuvers) { try { VerbProperties verb = current.verb; string text2 = Verb.CalculateUniqueLoadID(this.directOwner, tool, current); this.InitVerb(creator(verb.verbClass, text2), verb, tool, current, text2); } catch (Exception ex2) { Log.Error(string.Concat(new object[] { "Could not instantiate Verb (directOwner=", this.directOwner.ToStringSafe <IVerbOwner>(), "): ", ex2 }), false); } } } } }
private void InitVerbs(Func <Type, string, Verb> creator) { List <VerbProperties> verbProperties = directOwner.VerbProperties; if (verbProperties != null) { for (int i = 0; i < verbProperties.Count; i++) { try { VerbProperties verbProperties2 = verbProperties[i]; string text = Verb.CalculateUniqueLoadID(directOwner, i); InitVerb(creator(verbProperties2.verbClass, text), verbProperties2, null, null, text); } catch (Exception ex) { Log.Error("Could not instantiate Verb (directOwner=" + directOwner.ToStringSafe() + "): " + ex); } } } List <Tool> tools = directOwner.Tools; if (tools == null) { return; } for (int j = 0; j < tools.Count; j++) { Tool tool = tools[j]; foreach (ManeuverDef maneuver in tool.Maneuvers) { try { VerbProperties verb = maneuver.verb; string text2 = Verb.CalculateUniqueLoadID(directOwner, tool, maneuver); InitVerb(creator(verb.verbClass, text2), verb, tool, maneuver, text2); } catch (Exception ex2) { Log.Error("Could not instantiate Verb (directOwner=" + directOwner.ToStringSafe() + "): " + ex2); } } } }
private void InitVerbs(Func <Type, string, Verb> creator) { List <VerbProperties> verbProperties = this.directOwner.VerbProperties; if (verbProperties != null) { for (int i = 0; i < verbProperties.Count; i++) { try { VerbProperties verbProperties2 = verbProperties[i]; string text = Verb.CalculateUniqueLoadID(this.directOwner, i); this.InitVerb(creator(verbProperties2.verbClass, text), verbProperties2, this.directOwner, null, null, text); } catch (Exception ex) { Log.Error(string.Concat(new object[] { "Could not instantiate Verb (directOwner=", this.directOwner.ToStringSafe <IVerbOwner>(), "): ", ex }), false); } } } List <Tool> tools = this.directOwner.Tools; if (tools != null) { for (int j = 0; j < tools.Count; j++) { Tool tool = tools[j]; foreach (ManeuverDef maneuverDef in from maneuver in DefDatabase <ManeuverDef> .AllDefsListForReading where tool.capacities.Contains(maneuver.requiredCapacity) select maneuver) { try { VerbProperties verb = maneuverDef.verb; string text2 = Verb.CalculateUniqueLoadID(this.directOwner, tool, maneuverDef); this.InitVerb(creator(verb.verbClass, text2), verb, this.directOwner, tool, maneuverDef, text2); } catch (Exception ex2) { Log.Error(string.Concat(new object[] { "Could not instantiate Verb (directOwner=", this.directOwner.ToStringSafe <IVerbOwner>(), "): ", ex2 }), false); } } } } Pawn pawn = this.directOwner as Pawn; if (pawn != null && !pawn.def.tools.NullOrEmpty <Tool>()) { for (int k = 0; k < pawn.def.tools.Count; k++) { Tool tool = pawn.def.tools[k]; foreach (ManeuverDef maneuverDef2 in from maneuver in DefDatabase <ManeuverDef> .AllDefsListForReading where tool.capacities.Contains(maneuver.requiredCapacity) select maneuver) { try { VerbProperties verb2 = maneuverDef2.verb; string text3 = Verb.CalculateUniqueLoadID(this.directOwner, tool, maneuverDef2); this.InitVerb(creator(verb2.verbClass, text3), verb2, this.directOwner, tool, maneuverDef2, text3); } catch (Exception ex3) { Log.Error(string.Concat(new object[] { "Could not instantiate Verb (directOwner=", this.directOwner.ToStringSafe <IVerbOwner>(), "): ", ex3 }), false); } } } } }
private void InitVerbs(Func <Type, string, Verb> creator) { List <VerbProperties> verbProperties = this.directOwner.VerbProperties; if (verbProperties != null) { for (int i = 0; i < verbProperties.Count; i++) { try { VerbProperties verbProperties2 = verbProperties[i]; string text = Verb.CalculateUniqueLoadID(this.directOwner, i); this.InitVerb(creator(verbProperties2.verbClass, text), verbProperties2, this.directOwner, null, null, text); if (verbProperties2.LaunchesProjectile && !verbProperties2.onlyManualCast) { VerbProperties verbProperties3 = verbProperties2.MemberwiseClone(); verbProperties3.defaultCooldownTime += verbProperties3.warmupTime; verbProperties3.warmupTime = 0f; verbProperties3.meleeShoot = true; string text2 = Verb.CalculateUniqueLoadID(this.directOwner, -1 - i); this.InitVerb(creator(verbProperties2.verbClass, text2), verbProperties2, this.directOwner, null, null, text2); } } catch (Exception ex) { Log.Error(string.Concat(new object[] { "Could not instantiate Verb (directOwner=", this.directOwner.ToStringSafe <IVerbOwner>(), "): ", ex })); } } } List <Tool> tools = this.directOwner.Tools; if (tools != null) { for (int j = 0; j < tools.Count; j++) { Tool tool = tools[j]; foreach (ManeuverDef current in from maneuver in DefDatabase <ManeuverDef> .AllDefsListForReading where tool.capacities.Contains(maneuver.requiredCapacity) select maneuver) { try { VerbProperties verb = current.verb; string text3 = Verb.CalculateUniqueLoadID(this.directOwner, tool, current); this.InitVerb(creator(verb.verbClass, text3), verb, this.directOwner, tool, current, text3); } catch (Exception ex2) { Log.Error(string.Concat(new object[] { "Could not instantiate Verb (directOwner=", this.directOwner.ToStringSafe <IVerbOwner>(), "): ", ex2 })); } } } } Pawn pawn = this.directOwner as Pawn; if (pawn != null && !pawn.def.tools.NullOrEmpty <Tool>()) { for (int k = 0; k < pawn.def.tools.Count; k++) { Tool tool = pawn.def.tools[k]; foreach (ManeuverDef current2 in from maneuver in DefDatabase <ManeuverDef> .AllDefsListForReading where tool.capacities.Contains(maneuver.requiredCapacity) select maneuver) { try { VerbProperties verb2 = current2.verb; string text4 = Verb.CalculateUniqueLoadID(this.directOwner, tool, current2); this.InitVerb(creator(verb2.verbClass, text4), verb2, this.directOwner, tool, current2, text4); } catch (Exception ex3) { Log.Error(string.Concat(new object[] { "Could not instantiate Verb (directOwner=", this.directOwner.ToStringSafe <IVerbOwner>(), "): ", ex3 })); } } } } }