Esempio n. 1
0
 /// <summary>
 /// Creates crates that are being imported for exporting.
 /// </summary>
 private void CreateCrates()
 {
     for (int i = 0; i < 10; i++)
     {
         Crate newCrate = new Crate(-1, 0, 25);
         importCrates.Add(newCrate);
     }
 }
Esempio n. 2
0
 public void GiveTask(RobotTask rt)
 {
     pickupTask     = rt.pickUpTask;
     dropoffTask    = rt.dropOffTask;
     _pickupCrate   = rt.pickUpCrate;
     _pickUpTarget  = rt.pickUpTarget;
     _dropOffTarget = rt.dropOffTarget;
     HandleTask();
 }
Esempio n. 3
0
        /// <summary>
        /// Creates a Object3D of given type.
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="z"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private Object3D CreateObject(double x, double y, double z, string type)
        {
            switch (type)
            {
            case "Robot":
                Object3D r = new Robot(x, y, z, 0, 0, 0);
                worldObjects.Add(r);
                return(r);

            case "Export":
                Object3D e = new ExportVehicle(x, y, z, 0, Math.PI, 0);
                worldObjects.Add(e);
                return(e);

            case "Import":
                Object3D i = new ImportVehicle(x, y, z, 0, 0.5 * Math.PI, 0);
                worldObjects.Add(i);
                return(i);

            case "Crate":
                Object3D c = new Crate(x, y, z);
                worldObjects.Add(c);
                return(c);

            case "Shelf":
                Object3D s = new StationaryObject(x, y, z, 0, 0, 0, "Shelf");
                worldObjects.Add(s);
                return(s);

            case "Refinery":
                Object3D refi = new Refinery(x, y, z, 0, 0, 0);
                worldObjects.Add(refi);
                return(refi);

            default:
                throw new ArgumentException("there is no model that corresponds with that type");
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Triggered by robot when droping the crate by DropOffTarget.
 /// </summary>
 /// <param name="crate"></param>
 public void HandelDropOff(Crate crate)
 {
     this._storedCrate = crate;
     crate.Move(position[0], 0.39, position[1]);
     _isDone = true;
 }
Esempio n. 5
0
 /// <summary>
 /// Triggered by robot when droping the crate by DropOffTarget.
 /// </summary>
 /// <param name="crate"></param>
 public void HandelDropOff(Crate crate)
 {
     LoadWeight(crate.weight);
     crate.SetIsDone();
 }