Beispiel #1
0
        private Barrels CreateChest(decimal x, decimal y, decimal z)
        {
            Barrels r = new Barrels(x, y, z, 0, 0, 0);

            worldObjects.Add(r);
            return(r);
        }
Beispiel #2
0
        private Barrels CreateChest(Point p)
        {
            Barrels r = new Barrels(p);

            worldObjects.Add(r);
            return(r);
        }
Beispiel #3
0
        private Barrels CreateBarrels(Point a)
        {
            Barrels b = new Barrels(a);

            worldObjects.Add(b);
            return(b);
        }
Beispiel #4
0
 public void AddChest(Barrels chest)
 {
     if (chest != null)
     {
         chest.AssignPoint(this);
     }
     this._chest = chest;
 }
Beispiel #5
0
 public void AssignChest(Barrels chest)
 {
     if (chest.point == this.currentPoint)
     {
         chest.AssignPoint(null);
         this._chest = chest;
         _chest.Move(this._x, this._y + 1, this._z);
         needsUpdate = true;
     }
 }
Beispiel #6
0
        public Robot(Point point)
        {
            this.type = "robot";
            this.guid = Guid.NewGuid();

            this._x = point.x;
            this._y = point.y;
            this._z = point.z;

            _currentPoint      = point;
            this._desiredPoint = _currentPoint;
            route.Add(_currentPoint);

            this._chest = null;
        }
Beispiel #7
0
        public Robot(decimal x, decimal y, decimal z, decimal rotationX, decimal rotationY, decimal rotationZ)
        {
            this.type = "robot";
            this.guid = Guid.NewGuid();

            this._x = x;
            this._y = y;
            this._z = z;

            this._rX = rotationX;
            this._rY = rotationY;
            this._rZ = rotationZ;

            this._chest = null;
        }
Beispiel #8
0
 public void AddChest(Barrels chest)
 {
     _chests.Add(chest);
     chest.AssignPoint(null);
     chest.Move(this.x, this.y + 0.2m, this.z);
 }
Beispiel #9
0
        // locations for the boat, robots and packages
        public World()
        {
            Point a = new Point(-20, 0, 0);
            Point b = new Point(-10, 0, 0);
            Point c = new Point(-10, 0, 10);
            Point d = new Point(0, 0, 10);
            Point e = new Point(10, 0, 10);
            Point f = new Point(10, 0, 0);
            Point g = new Point(10, 0, -10);
            Point h = new Point(0, 0, -10);
            Point i = new Point(-10, 0, -10);
            Point j = new Point(0, 0, 0);

            Point tA = new Point(-20, 0, -50);
            Point tB = new Point(-20, 0, 0);
            Point tC = new Point(-20, 0, 50);

            a.AddNode(b);
            b.AddNode(new List <Point>()
            {
                c, i
            });
            c.AddNode(d);
            d.AddNode(new List <Point>()
            {
                e, j
            });
            e.AddNode(f);
            f.AddNode(g);
            h.AddNode(new List <Point>()
            {
                i, j, g
            });

            tB.AddNode(new List <Point>()
            {
                tA, tB
            });

            List <Point> pointList = new List <Point>()
            {
                a, b, c, d, e, f, g, h, i, j
            };

            pointGraph = new Graph((pointList));

            boatGraph = new Graph(new List <Point>()
            {
                tA, tB, tC
            });

            Robot robot1 = CreateRobot(a);
            Robot robot2 = CreateRobot(a);
            Robot robot3 = CreateRobot(a);

            LightHouse lighthouse1 = CreateLighthouse(0, 0, 0);

            Barrels barrels1 = CreateBarrels(c);

            Barrels chest1 = CreateChest(e);
            Barrels chest2 = CreateChest(i);
            Barrels chest3 = CreateChest(j);
            Barrels chest4 = CreateChest(g);
            Barrels chest5 = CreateChest(b);
            Barrels chest6 = CreateChest(c);

            Boat t = CreateBoat(tA);

            robot1.AddTask(new RobotMove(pointGraph, chest1.point));
            robot2.AddTask(new RobotMove(pointGraph, chest2.point));
            robot3.AddTask(new RobotMove(pointGraph, chest3.point));
            robot1.AddTask(new RobotMove(pointGraph, chest4.point));
            robot2.AddTask(new RobotMove(pointGraph, chest5.point));
            robot3.AddTask(new RobotMove(pointGraph, chest6.point));

            int counter = 3;

            foreach (Model3D r in worldObjects)
            {
                if (r is Robot)
                {
                    ((Robot)r).AddTask(new RobotPickUp());
                    ((Robot)r).AddTask(new RobotMove(pointGraph, a));
                    ((Robot)r).AddTask(new RobotDropOff(t));
                    ((Robot)r).AddTask(new RobotPickUp());
                    ((Robot)r).AddTask(new RobotMove(pointGraph, pointList[counter]));
                    ((Robot)r).AddTask(new RobotDropOff(pointList[counter]));
                    counter++;
                    ((Robot)r).AddTask(new RobotMove(pointGraph, a));
                }
            }

            t.AddTask(new BoatMove(tB));
            t.AddTask(new BoatLoad());
            t.AddTask(new BoatMove(tC));
            t.AddTask(new BoatTeleport(tA));
            t.AddTask(new BoatMove(tB));
            t.AddTask(new BoatDump(a));
            t.AddTask(new BoatMove(tC));
        }
Beispiel #10
0
 public void RemoveChest(Point point)
 {
     point.AddChest(this.chest);
     this._chest.AssignPoint(point);
     this._chest = null;
 }
Beispiel #11
0
 public void RemoveChest(Boat boat)
 {
     boat.AddChest(this.chest);
     this._chest = null;
 }