示例#1
0
 public ConsideredPosition(Point position, ObstacleSurface surface, int score, PoseMechanism pose)
 {
     Position  = position;
     Pose      = pose;
     RestingOn = surface;
     CostScore = score;
 }
示例#2
0
 public ConsideredPosition(Point position, Room world, int score, PoseMechanism pose)
 {
     Position  = position;
     Pose      = pose;
     World     = world;
     CostScore = score;
 }
示例#3
0
        //public List<ConsideredPosition> EndPoints;

        public void AddStartPoint(ObstacleSurface mySurface, Point position, int score, ConsideredPosition previousPosition, PoseMechanism pose, TryGoEvent context)
        {
            if (StartPoints == null)
            {
                StartPoints = new List <ConsideredPosition>();
            }
            else
            {
                foreach (ConsideredPosition point in StartPoints)
                {
                    if (point.Position.Equals(position))
                    {
                        if (score < point.CostScore)
                        {
                            //TODO: I don't think this can actually be reached. It might be good to update scores of future points if it does though?
                            //There's not a good way to do that currently though, so not doing that right now.
                            point.PreviousPositions.Insert(0, previousPosition);
                            point.CostScore = score;
                        }
                        else
                        {
                            point.PreviousPositions.Add(previousPosition);
                        }
                        return;
                    }
                }
            }
            //Not found yet, need to create a new point.
            ConsideredPosition newPoint = new ConsideredPosition(position, mySurface, score, pose);

            StartPoints.Add(newPoint);
            //Since it's new, connect to all end points on this surface.
            if (EndPoints != null)
            {
                //foreach (ConsideredPosition endPoint in EndPoints)
                //{
                //    context.ConsiderSurfacePath(newPoint, endPoint);
                //}
            }
        }