public KruispuntWachtrij(Direction[] directions, Direction from, IKruispunt kruispunt)
        {
            this.directions = directions;
            this.from = from;
            this.kruispunt = kruispunt;

            autos = new Queue<Auto>();
        }
Example #2
0
 public void addKruispunt(IKruispunt kruispunt, Direction direction)
 {
     switch (direction) {
         case Direction.EAST:
             east = kruispunt;
             break;
         case Direction.WEST:
             west = kruispunt;
             break;
         case Direction.SOUTH:
             south = kruispunt;
             break;
     }
 }
Example #3
0
        public void addAuto(Auto auto, IKruispunt afkomst)
        {
            Direction direction;
            if (afkomst == north) {
                direction = Direction.NORTH;
            } else if (afkomst == south) {
                direction = Direction.SOUTH;
            } else if (afkomst == east) {
                direction = Direction.EAST;
            } else {
                direction = Direction.WEST;
            }

            addAuto(auto, direction);
        }
Example #4
0
 public KruispuntType3(IKruispunt kruispunt, Simulator simulator)
 {
     this.simulator = simulator;
     this.ticks = this.simulator.Ticks;
     this.kruispunt = kruispunt;
 }
Example #5
0
        private KruispuntForm loadKruispunt(IKruispunt load)
        {
            KruispuntForm kruispunt;

            if (load is Type1)
            {
                load = load as Type1;
                kruispunt = new TKP1(load);
            }
            else if (load is Type2)
            {
                load = load as Type2;
                kruispunt = new TKP2(load);
            }
            else if (load is Type3)
            {
                load = load as Type3;
                kruispunt = new TKP3(load);
            }
            else if (load is Type4)
            {
                load = load as Type4;
                kruispunt = new TKP4(load);
            }
            else
            {
                return null;
            }

            return kruispunt;
        }
 public KruispuntWachtrij(IKruispunt kruispunt)
 {
     this.kruispunt = kruispunt;
     autos          = new List<Auto>();
 }
Example #7
0
 public void removeAuto(Auto auto, IKruispunt afkomst)
 {
 }
Example #8
0
 public void addKruispunt(IKruispunt kruispunt, int pos)
 {
     kruispunten[pos] = new KruispuntWachtrij(kruispunt);
 }
Example #9
0
 public void addAuto(Auto auto, IKruispunt afkomst)
 {
 }