/// <summary> /// Grabs the slotName that the given <see cref="BodyPart"/> resides in. Returns true if the <see cref="BodyPart"/> is /// part of this body and a slot is found, false otherwise. If false, result will be null. /// </summary> public bool TryGetSlotName(BodyPart part, out string result) { result = _partDictionary.FirstOrDefault(x => x.Value == part).Key; //We enforce that there is only one of each value in the dictionary, so we can iterate through the dictionary values to get the key from there. return(result == null); }
/// <summary> /// Grabs the <see cref="BodyPart"/> in the given slotName if there is one. Returns true if a <see cref="BodyPart"/> is found, /// false otherwise. If false, result will be null. /// </summary> public bool TryGetBodyPart(string slotName, out BodyPart result) { return(_partDictionary.TryGetValue(slotName, out result)); }
public BiologicalSurgeryData(BodyPart parent) : base(parent) { }
public override bool CanAttachBodyPart(BodyPart toBeConnected) { return(true); //TODO: if a bodypart is disconnected, you should have to do some surgery to allow another bodypart to be attached. }
public ISurgeryData(BodyPart parent) { _parent = parent; }
/// <summary> /// Returns whether the given <see cref="BodyPart"/> can be connected to the <see cref="BodyPart"/> this ISurgeryData represents. /// </summary> public abstract bool CanAttachBodyPart(BodyPart toBeConnected);
public bool CanAttachBodyPart(BodyPart toBeConnected) { return(_surgeryData.CanAttachBodyPart(toBeConnected)); }