private void DisplayAttachmentContents(StackPanel entry, AttachmentPoint point)
        {
            StackPanel contents = Utilities.FindNode <StackPanel>(entry, "Contents");

            foreach (GameObject obj in point.GetAttached())
            {
                Grid objEntry = GameManager.instance.GetResource <Grid>("AttachmentObjectEntry");
                contents.Children.Add(objEntry);

                TextBlock text = Utilities.FindNode <TextBlock>(objEntry, "Data1");
                if (text != null)
                {
                    text.Inlines.Add(observer.Observe(obj, "name upper").span);
                }

                text = Utilities.FindNode <TextBlock>(objEntry, "Data2");
                if (text != null)
                {
                    text.Inlines.Add(observer.Observe(obj, "weight").span);
                }

                text = Utilities.FindNode <TextBlock>(objEntry, "Data3");
                if (text != null)
                {
                    text.Inlines.Add(observer.Observe(obj, "volume").span);
                }
            }

            if (contents.Children.Count == 0)
            {
                contents.Children.Add(WaywardTextParser.ParseAsBlock("<i>empty</i>"));
            }
        }
Ejemplo n.º 2
0
        public override bool SetContainer(AttachmentPoint newContainer)
        {
            bool result = base.SetContainer(newContainer);

            if (!result)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
        public virtual bool SetContainer(AttachmentPoint newContainer)
        {
            bool result = newContainer != null && !newContainer.Contains(this);

            if (result)
            {
                return(false);
            }

            _container = newContainer;
            return(true);
        }
Ejemplo n.º 4
0
        public override bool SetContainer(AttachmentPoint newContainer)
        {
            bool result = base.SetContainer(newContainer);

            if (!result)
            {
                return(false);
            }

            foreach (Physical part in parts)
            {
                part.SetContainer(newContainer);
            }

            return(true);
        }