Exemple #1
0
 public void OnSlotEnumFlag_EditorChanged()
 {
     foreach (GridPosR.Orientation orientation in Enum.GetValues(typeof(GridPosR.Orientation)))
     {
         Slots[orientation].IsCandidate = SlotEnumFlag_Editor.HasFlag(orientation.ToFlag());
     }
 }
        public void SetConnection(GridPosR.OrientationFlag adjacentConnection, GridPosR.OrientationFlag diagonalConnection)
        {
            foreach (GridPosR.Orientation orientation in Enum.GetValues(typeof(GridPosR.Orientation)))
            {
                MainImageBorders[(int)orientation].enabled = !adjacentConnection.HasFlag(orientation.ToFlag());

                GridPosR.Orientation next = GridPosR.RotateOrientationClockwise90(orientation);
                if (!adjacentConnection.HasFlag(orientation.ToFlag()) && !adjacentConnection.HasFlag(next.ToFlag()))
                {
                    SideImageBorders[((int)orientation) * 2].enabled     = false;
                    SideImageBorders[((int)orientation) * 2 + 1].enabled = false;
                }
                else if (adjacentConnection.HasFlag(orientation.ToFlag()) && adjacentConnection.HasFlag(next.ToFlag()))
                {
                    if (diagonalConnection.HasFlag(orientation.ToFlag()))
                    {
                        SideImageBorders[((int)orientation) * 2].enabled     = false;
                        SideImageBorders[((int)orientation) * 2 + 1].enabled = false;
                    }
                    else
                    {
                        SideImageBorders[((int)orientation) * 2].enabled     = true;
                        SideImageBorders[((int)orientation) * 2 + 1].enabled = true;
                    }
                }
                else
                {
                    if (adjacentConnection.HasFlag(orientation.ToFlag()))
                    {
                        SideImageBorders[((int)orientation) * 2].enabled     = true;
                        SideImageBorders[((int)orientation) * 2 + 1].enabled = false;
                    }
                    else
                    {
                        SideImageBorders[((int)orientation) * 2].enabled     = false;
                        SideImageBorders[((int)orientation) * 2 + 1].enabled = true;
                    }
                }
            }
        }