Ejemplo n.º 1
0
        public void Next()
        {
            TileBase parent = task.Pop();

            ++currentCount;

            if (parent)
            {
                set.Add(TileBase.HashNameFromPosition(parent.transform.position));
            }
            else
            {
                return;
            }

            foreach (Neighbor i in parent.FindNeighbors(factory))
            {
                Vector3 position = parent.transform.position + i.Offset;

                if (board.ValidPosition(position))
                {
                    if (!set.Contains(TileBase.HashNameFromPosition(position)))
                    {
                        TileBase tileBase = board.Replace(position, i.Tile);
                        tileBase.transform.eulerAngles = new Vector3(0.0f, 0.0f, i.Rotation);

                        task.Push(tileBase);
                    }
                }
            }
        }