Ejemplo n.º 1
0
        private void PopulateGrid()
        {
            var intermediateValues = path.GetExtrapolator().GetIntermediateValues();

            foreach (var enemyPathNode in intermediateValues)
            {
                // cache the location for later.
                var enemyPathNodeLocation = enemyPathNode.Location;
                var pathNodeInstance      = instantiator.CreateInstance(this, enemyPathNodeLocation);

                // see if we can enable either the input or the output constraints.
                if (enemyPathNode.IncomingDirection != null)
                {
                    pathNodeInstance.Enable(enemyPathNode.IncomingDirection.Value);
                }
                if (enemyPathNode.OutgoingDirection != null)
                {
                    pathNodeInstance.Enable(enemyPathNode.OutgoingDirection.Value);
                }


                this[enemyPathNodeLocation] = pathNodeInstance;
            }
        }
 protected virtual void RecalculateStartAndEndNodes()
 {
     ActiveStartNode = path.GetExtrapolator().GetMinimalRepresentation().First();
     ActiveEndNode   = path.GetExtrapolator().GetMinimalRepresentation().Last();
 }