public bool Check(BoxMovingStep movingStep)
        {
            KakuBoxState state = (KakuBoxState)movingStep.Final;

            var finds = queue.FindSameBoxState(state);

            if (finds.Count > 0)
            {
                foreach (var find in finds)
                {
                    if (find.Kaku.Equals(state.Kaku))
                    {
                        return(false);
                    }
                    else
                    {
                        var newMap = map.Clone();

                        newMap.Barriers.AddRange(find.Copy());

                        PointToPointPathFinder pathFinder = new PointToPointPathFinder(newMap, find.Kaku);

                        if (pathFinder.HasPath(state.Kaku))
                        {
                            return(false);
                        }
                    }
                }
            }
            return(true);
        }
        public bool Check(BoxMovingStep movingStep)
        {
            KakuBoxMovingStep thisStep = movingStep as KakuBoxMovingStep;

            if (thisStep == null)
            {
                throw new InvalidOperationException("KakuMovingCheckPolicy only check KakuBoxMovingStep.");
            }

            if (((KakuBoxState)thisStep.Orignal).Kaku == thisStep.KakuPushingPoint)
            {
                return(true);
            }

            var newMap = map.Clone();

            newMap.Barriers.AddRange(thisStep.Orignal.Copy());

            if (!newMap.IsValidPoint(thisStep.kakuPushingPoint))
            {
                return(false);
            }

            PointToPointPathFinder pathFinder = new PointToPointPathFinder(newMap, ((KakuBoxState)thisStep.Orignal).Kaku);

            return(pathFinder.HasPath(thisStep.KakuPushingPoint));
        }
 public bool Check(BoxMovingStep movingStep)
 {
     return(this.queue.FindSameBoxState(movingStep.Final).Count == 0);
 }
 public bool Check(BoxMovingStep movingStep)
 {
     return(!movingStep.Final.IsOverlapping);
 }
 public bool Check(BoxMovingStep movingStep)
 {
     return(movingStep.Final.IsMeetMap(map));
 }
 public bool Check(BoxMovingStep movingStep)
 {
     return(policies.All(p => p.Check(movingStep)));
 }