示例#1
0
        public static Point GetLocationFromTag(this Slot slot)
        {
            try
            {
                if (slot?.Tag != null)
                {
                    int index = (int)slot.Tag;
                    if (slot is HandSlot)
                    {
                        return(HandController.CalculateLocation(index));
                    }
                    else if (slot is BoardSlot boardSlot)
                    {
                        return(new Point(boardSlot.Position.PositionX,
                                         boardSlot.Position.PositionY));
                    }
                }
            }
            catch
            {
            }

            return(Point.Empty);
        }