Beispiel #1
0
 public void removeLightSourceType(LightSource.Type lightType) {
   if (lightSourceList != null) {
     for (ListIterator<AttachedLightSource> i = lightSourceList.listIterator(); i.hasNext(); ) {
       AttachedLightSource als = i.next();
       LightSource lightSource = MapTool.getCampaign().getLightSource(als.getLightSourceId());
       if (lightSource != null && lightSource.getType() == lightType) i.remove();
     }
   }
 }
Beispiel #2
0
 public boolean hasLightSourceType(LightSource.Type lightType) {
   if (lightSourceList != null) {
     for (ListIterator<AttachedLightSource> i = lightSourceList.listIterator(); i.hasNext(); ) {
       AttachedLightSource als = i.next();
       LightSource lightSource = MapTool.getCampaign().getLightSource(als.getLightSourceId());
       if (lightSource != null && lightSource.getType() == lightType) return true;
     }
   }
   return false;
 }
Beispiel #3
0
 public void removeOwnerOnlyAuras() {
   if (lightSourceList != null) {
     for (ListIterator<AttachedLightSource> i = lightSourceList.listIterator(); i.hasNext(); ) {
       AttachedLightSource als = i.next();
       LightSource lightSource = MapTool.getCampaign().getLightSource(als.getLightSourceId());
       if (lightSource != null) {
         List<Light> lights = lightSource.getLightList();
         for (Light light : lights) {
           if (light.isOwnerOnly()) i.remove();
         }
       }
     }
   }
 }
Beispiel #4
0
  public void world2Cam(final Camera aCamera) throws PolygonException, MatrixException {
    // TODO optimized code for multi core processors, but does dis has the wanted effect?

    for (int i = 0; i < myShapes.length; i++) {
      myShapes[i].world2Cam(aCamera);
    }
    for (int i = 0; i < myPointShapes.length; i++) {
      myPointShapes[i].world2Cam(aCamera);
    }

    for (LightSource theLighteSource : lightSources) {
      theLighteSource.world2Cam(aCamera);
    }
  }
Beispiel #5
0
 public boolean hasGMAuras() {
   if (lightSourceList != null) {
     for (ListIterator<AttachedLightSource> i = lightSourceList.listIterator(); i.hasNext(); ) {
       AttachedLightSource als = i.next();
       LightSource lightSource = MapTool.getCampaign().getLightSource(als.getLightSourceId());
       if (lightSource != null) {
         List<Light> lights = lightSource.getLightList();
         for (Light light : lights) {
           if (light.isGM()) return true;
         }
       }
     }
   }
   return false;
 }
Beispiel #6
0
 public void removeLightSource(LightSource source) {
   if (lightSourceList == null) {
     return;
   }
   for (ListIterator<AttachedLightSource> i = lightSourceList.listIterator(); i.hasNext(); ) {
     AttachedLightSource als = i.next();
     if (als != null
         && als.getLightSourceId() != null
         && als.getLightSourceId().equals(source.getId())) {
       i.remove();
     }
   }
 }
Beispiel #7
0
 public boolean hasLightSource(LightSource source) {
   if (lightSourceList == null) {
     return false;
   }
   for (ListIterator<AttachedLightSource> i = lightSourceList.listIterator(); i.hasNext(); ) {
     AttachedLightSource als = i.next();
     if (als != null
         && als.getLightSourceId() != null
         && als.getLightSourceId().equals(source.getId())) {
       return true;
     }
   }
   return false;
 }
 @Override
 public void setDuration(int duration) {
   readableText = "" + duration;
   super.setDuration(duration);
 }