/// <summary> /// This function allows you to get a bodypart of this player based on the Type. /// </summary> /// <param name="bodyPartTypeToGet">The type of bodypart to find.</param> /// <returns>Return the type of bodypart you requested if found. Returns null otherwise.</returns> public BodyPart GetBodyPart(System.Type bodyPartTypeToGet) { if (bodyPartTypeToGet == leftHand.GetType()) { return(leftHand); } if (bodyPartTypeToGet == rightHand.GetType()) { return(rightHand); } if (bodyPartTypeToGet == head.GetType()) { return(head); } return(null); }
public bool HasWeaponType(Type type) { return(RightHand != null && RightHand.GetType() == type || LeftHand != null && LeftHand.GetType() == type); }