コード例 #1
0
        private string ComplexDeflectionOutImageSource(Position position)
        {
            string            imgSrc    = string.Empty;
            LightBoxDirection direction = Direction(position);

            switch (direction)
            {
            case LightBoxDirection.LightBoxLeft:
                imgSrc = "/icons/LightBox.ComplexDeflection.Left.png";
                break;

            case LightBoxDirection.LightBoxRight:
                imgSrc = "/icons/LightBox.ComplexDeflection.Right.png";
                break;

            case LightBoxDirection.LightBoxTop:
                imgSrc = "/icons/LightBox.ComplexDeflection.Top.png";
                break;

            case LightBoxDirection.LightBoxBottom:
                imgSrc = "/icons/LightBox.ComplexDeflection.Bottom.png";
                break;

            default:
                break;
            }
            return(imgSrc);
        }
コード例 #2
0
        private LightBoxDirection Direction(Position position)
        {
            LightBoxDirection direction = LightBoxDirection.LightBoxLeft;

            if (position.Row == 0)
            {
                direction = LightBoxDirection.LightBoxLeft;
            }
            else if (position.Column == 0)
            {
                direction = LightBoxDirection.LightBoxTop;
            }
            else if (position.Row == BlackboxConfig.GameBoardRow - 1)
            {
                direction = LightBoxDirection.LightBoxRight;
            }
            else
            {
                direction = LightBoxDirection.LightBoxBottom;
            }
            return(direction);
        }