Ejemplo n.º 1
0
        private void SetTopLeft(Point NewValue, bool CheckIfChanged = true)
        {
            if (!CheckIfChanged || TopLeftScreenPosition != NewValue)
            {
                _TopLeftScreenPosition = NewValue;

                if (RelativeInventorySlotBounds != null)
                {
                    List <Rectangle> TranslatedSlots = new List <Rectangle>();
                    foreach (Rectangle Relative in RelativeInventorySlotBounds)
                    {
                        Rectangle Translated = Relative.GetOffseted(TopLeftScreenPosition);
                        TranslatedSlots.Add(Translated);
                    }
                    this.InventorySlotBounds = new ReadOnlyCollection <Rectangle>(TranslatedSlots);
                }
                else
                {
                    this.InventorySlotBounds = null;
                }

                this.Bounds = RelativeBounds.GetOffseted(TopLeftScreenPosition);
            }
        }