public override void DisplayContents() { // XXX: This bypasses the observer rule foreach (AttachmentPoint point in physicalTarget.GetAttachmentPoints()) { StackPanel entry = GameManager.instance.GetResource <StackPanel>("DescriptiveAttachmentEntry"); attachmentsPanel.Children.Add(entry); TextBlock text = Utilities.FindNode <TextBlock>(entry, "AttachmentName"); if (text != null) { text.Text = char.ToUpper(point.name[0]) + point.name.Substring(1); } if (point.maxQuantity != -1) { text = Utilities.FindNode <TextBlock>(entry, "Quantity"); if (text != null) { if (observer.CanObserve(physicalTarget)) { text.Text = $"{point.GetAttached().Length.ToString()}/{point.maxQuantity.ToString()}"; } else { text.Text = "???"; } } } PhysicalAttachmentPoint physicalPoint = point as PhysicalAttachmentPoint; if (physicalPoint != null) { text = Utilities.FindNode <TextBlock>(entry, "VolumeRatio"); if (text != null) { if (observer.CanObserve(physicalTarget)) { if (physicalPoint.capacity >= 0) { text.Text = $"{physicalPoint.filledCapacity.ToString()} L/{physicalPoint.capacity.ToString()} L"; } else { text.Text = $"{physicalPoint.filledCapacity.ToString()} L"; } } else { text.Text = "???"; } } } DisplayAttachmentContents(entry, point); } if (attachmentsPanel.Children.Count == 0) { element.Visibility = System.Windows.Visibility.Collapsed; } }
public virtual void RemoveAttachmentPoint(PhysicalAttachmentPoint point) { attachmentPoints.Remove(point); }
public virtual void AddAttachmentPoint(PhysicalAttachmentPoint point) { attachmentPoints.Add(point); }
/// <summary> /// Amalgams cannot have their own attachment points. Add points to the amalgam's parts instead. /// </summary> /// <param name="material"></param> /// <param name="parts"></param> public override void RemoveAttachmentPoint(PhysicalAttachmentPoint point) { return; }