Пример #1
0
        public Map(bool[] newwallMap, int mapwidth, Collection <Actor> newactors, Dictionary <Node, char> newboxes, GoalList newgoals, Dictionary <char, Color> colorDict)
        {
            id       = Map.nextId++;
            wallMap  = newwallMap;
            mapWidth = mapwidth;

            actors = new ActorList(newactors, colorDict);
            boxes  = new BoxList(newboxes, colorDict);
            goals  = newgoals;
            steps  = 0;
        }
Пример #2
0
 public Map(Map oldmap)
 {
     id            = Map.nextId++;
     parent        = oldmap;
     actors        = new ActorList(oldmap.actors);
     boxes         = new BoxList(oldmap.boxes);
     steps         = oldmap.steps + 1;
     pathOfActor   = (Path[])oldmap.pathOfActor.Clone();
     targetOfActor = (int[])oldmap.targetOfActor.Clone();
     boxPriority   = new Dictionary <int, byte>(oldmap.boxPriority);
     boxDistance   = new Dictionary <int, int>(oldmap.boxDistance);
 }
Пример #3
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            ActorList al = (ActorList)obj;

            for (int i = 0; i < actors.Length; i++)
            {
                if (!this.actors[i].Equals(al.actors[i]))
                {
                    return(false);
                }
            }
            return(true);
        }
Пример #4
0
 public ActorList(ActorList oldlist)
 {
     actors = (Actor[])oldlist.actors.Clone();
 }