Exemplo n.º 1
0
        /// <summary>
        /// Sets the number to display. It also means that the cell is a path start or end.
        /// </summary>
        /// <param name="val">Value.</param>
        public void DefineCellAsPathStartOrEnd(int pathLength)
        {
            IsPathStartOrEnd = true;

            // The cell is the beginning or the end of a path
            Path = new Path(this, pathLength);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Fusion the specified other path.
        /// </summary>
        /// <param name="otherPath">Other path.</param>
        public void Fusion(Path otherPath)
        {
            // The otherPath is the loser
            // We transfer its data
            // Then we kill it

            // Dequeue cells
            for (int i= otherPath.Cells.Count - 1; i >= 0; i--) {
                Cell cell = otherPath.Cells [i];
                if (Cells.Contains (cell) == false) {
                    AddCell (cell);
                }
            }

            otherPath.Cells.Clear ();
        }