Exemple #1
0
 public void addRoad(Road r, int pos) throws InfraException {
   if (r == null) throw new InfraException("Parameter r is null");
   if (pos > 3 || pos < 0) throw new InfraException("Position out of range");
   if (allRoads[pos] != null)
     throw new InfraException("Road already connected to position " + pos);
   allRoads[pos] = r;
   Node other = r.getOtherNode(this);
   if (other == null || !other.isAlphaRoad(r))
     alphaRoads = (Road[]) Arrayutils.addElement(alphaRoads, r);
   updateLanes();
   calculateWidth();
 }
Exemple #2
0
 /** Adds a sign configuration */
 public void addSignconfig(Sign[] conf) throws InfraException {
   if (conf == null) throw new InfraException("Parameter conf is null");
   signconfigs = (Sign[][]) Arrayutils.addElement(signconfigs, conf);
 }