Пример #1
0
 /// <summary>
 /// Add a node to m_openNodes.
 /// </summary>
 /// <param name="node">The newly created node.</param>
 /// <param name="estimatedDistance">Distance from start to node + estimated distance to target.</param>
 public void AddOpenNode(ref PathNode node, float estimatedDistance)
 {
     if (m_openNodes.Count == MaxOpenNodes)
     {
         m_openNodes.RemoveMax();
     }
     m_openNodes.Insert(node, estimatedDistance);
 }
        public override bool TickAfterSimulationRoundRobin()
        {
            if (m_asteroidsToAdd.Count == 0)
            {
                return(false);
            }
            var ast = m_asteroidsToAdd.RemoveMax().Asteroid;

            ast.ExecuteSpawn();
            return(true);
        }
Пример #3
0
        public bool AddOneMarkedCell()
        {
            bool added = false;

            while (!added)
            {
                if (m_toAdd.Count == 0)
                {
                    return(added);
                }

                Vector3I cell = m_toAdd.RemoveMax();
                m_markedForAddition.Remove(ref cell);

                if (AddCell(cell))
                {
                    added = true;
                    break;
                }
            }

            return(added);
        }