using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; using Verse; namespace Rimworld_Animations { public class AnimationOffset_AgeRange : BaseAnimationOffset { public List offsetsMale; public List offsetsFemale; public override Vector3? getOffset(Pawn pawn) { List pawnOffsets = (pawn.gender == Gender.Male ? offsetsMale : offsetsFemale); return pawnOffsets.Find(x => x.bodyType == pawn.story.bodyType && x.ageRange.Includes(pawn.ageTracker.AgeBiologicalYears))?.offset ?? pawnOffsets.Last().offset; } public override int? getRotation(Pawn pawn) { List pawnOffsets = (pawn.gender == Gender.Male ? offsetsMale : offsetsFemale); return pawnOffsets.Find(x => x.bodyType == pawn.story.bodyType && x.ageRange.Includes(pawn.ageTracker.AgeBiologicalYears))?.rotation ?? pawnOffsets.Last().rotation; } public override Vector3? getScale(Pawn pawn) { List pawnOffsets = (pawn.gender == Gender.Male ? offsetsMale : offsetsFemale); return pawnOffsets.Find(x => x.bodyType == pawn.story.bodyType && x.ageRange.Includes(pawn.ageTracker.AgeBiologicalYears))?.scale ?? pawnOffsets.Last().scale; } } public class BodyTypeOffset_AgeRange : BodyTypeOffset { public FloatRange ageRange; } }