예제 #1
0
 protected string isCheckedRightOfShowSpecialField(string strReportID)
 {
     if (RightList.Contains(strReportID))
     {
         return(RightList[RightList.IndexOf(strReportID) + 1].StartsWith("0.1") ? " checked='checked' " : "");
     }
     return("");
 }
예제 #2
0
 protected string isCheckedRightOfOutput(string strReportID)
 {
     if (RightList.Contains(strReportID))
     {
         string strTmp = RightList[RightList.IndexOf(strReportID) + 1];
         return((strTmp.StartsWith("0.01") || strTmp.StartsWith("0.11")) ? " checked='checked' " : "");
     }
     return("");
 }
예제 #3
0
    protected string isCheckedRightOfOutputAll(string strReportID)
    {
        if (RightList.Contains(strReportID))
        {
            string strTmp = RightList[RightList.IndexOf(strReportID) + 1];

            if (strTmp.Length == 5)
            {
                strTmp += ",";

                return(strTmp.EndsWith("1,") ? " checked='checked' " : "");
            }
        }
        return("");
    }
예제 #4
0
 protected string isCheckedAddinRight(string strReportID)
 {
     if (strFucID.Equals(strReportID))
     {
         iIndex++;
     }
     else
     {
         strFucID = strReportID;
         iIndex   = 0;
     }
     if (RightList.Contains(strReportID) && RightList[RightList.IndexOf(strReportID) + 1].Length > iIndex + 2)
     {
         return((RightList[RightList.IndexOf(strReportID) + 1][iIndex + 2] == '1') ? " checked='checked' " : "");
     }
     return("");
 }
예제 #5
0
 private void CalculatePuzzleBounds()
 {
     for (int i = PuzzleSize - 1; i < PuzzleEndState.Count; i += PuzzleSize)
     {
         RightList.Add(i);
     }
     for (int i = 0; i < PuzzleEndState.Count; i += PuzzleSize)
     {
         LeftList.Add(i);
     }
     for (int i = 0; i < PuzzleSize; i++)
     {
         UpList.Add(i);
     }
     for (int i = PuzzleEndState.Count - PuzzleSize; i < PuzzleEndState.Count; i++)
     {
         DownList.Add(i);
     }
 }
예제 #6
0
        private Node Right(Node fromNode)
        {
            Node RightOfNode = new Node()
            {
                ParentNode = fromNode, Direction = Direction.Right, Length = fromNode.Length + 1, State = NodeState.Untested
            };
            List <int> CurrentPuzzleState = fromNode.PuzzleState.ToList();

            int Location = 0;
            int WhitePuzzlePieceLocation        = new int();
            int RightOfWhitePuzzlePieceLocation = new int();

            foreach (int item in CurrentPuzzleState)
            {
                if (item == MoveablePiece)
                {
                    WhitePuzzlePieceLocation        = Location;
                    RightOfWhitePuzzlePieceLocation = Location + 1;
                }
                Location++;
            }
            if (!RightList.Contains(WhitePuzzlePieceLocation))
            {
                CurrentPuzzleState = SwapLocation(CurrentPuzzleState, WhitePuzzlePieceLocation, RightOfWhitePuzzlePieceLocation);
                RightOfNode        = SetNodeInfo(RightOfNode, CurrentPuzzleState);
                // Debug.WriteLine("Right");
            }
            else
            {
                RightOfNode.IsMoveable = false;
                RightOfNode.State      = NodeState.Closed;
            }
            if (CheckCompletion(CurrentPuzzleState) == true)
            {
                RightOfNode.Direction = Direction.None;
                EndingNode            = RightOfNode;
            }
            return(RightOfNode);
        }
예제 #7
0
 protected string isCheckedReport(string strReportID)
 {
     return(RightList.Contains(strReportID) ? " checked='checked' " : "");
 }