public static List <Verb> GetConcreteExampleVerbs(Def def, out Thing owner, ThingDef stuff = null) { owner = null; List <Verb> result = null; ThingDef thingDef = def as ThingDef; if (thingDef != null) { Thing concreteExample = thingDef.GetConcreteExample(stuff); if (concreteExample is Pawn) { result = (concreteExample as Pawn).VerbTracker.AllVerbs; } else if (concreteExample is ThingWithComps) { result = (concreteExample as ThingWithComps).GetComp <CompEquippable>().AllVerbs; } else { result = null; } owner = concreteExample; } HediffDef hediffDef = def as HediffDef; if (hediffDef != null) { Hediff concreteExample2 = hediffDef.ConcreteExample; result = concreteExample2.TryGetComp <HediffComp_VerbGiver>().VerbTracker.AllVerbs; } return(result); }
public static List <Verb> GetConcreteExampleVerbs(Def def, ThingDef stuff = null) { List <Verb> result = null; ThingDef thingDef = def as ThingDef; if (thingDef != null) { Thing concreteExample = thingDef.GetConcreteExample(stuff); result = ((concreteExample is Pawn) ? ((Pawn)concreteExample).VerbTracker.AllVerbs : ((!(concreteExample is ThingWithComps)) ? null : ((ThingWithComps)concreteExample).GetComp <CompEquippable>().AllVerbs)); } HediffDef hediffDef = def as HediffDef; if (hediffDef != null) { result = hediffDef.ConcreteExample.TryGetComp <HediffComp_VerbGiver>().VerbTracker.AllVerbs; } return(result); }