namespace Sasalka; public class AttachmentSlotResolver { private readonly Func _attachmentGetter; public AttachmentSlotResolver( Func attachmentGetter ) { _attachmentGetter = attachmentGetter; } public GameObject GetSlotObject( Inventar.InventorySlot slot ) { return slot switch { Inventar.InventorySlot.LeftHand => _attachmentGetter.Invoke( "hold_L" ), Inventar.InventorySlot.RightHand => _attachmentGetter.Invoke( "hold_R" ), Inventar.InventorySlot.Body => _attachmentGetter.Invoke( "forward_reference_modelspace" ), _ => _attachmentGetter.Invoke( "forward_reference_modelspace" ) }; } }