Exemplo n.º 1
0
 public final void visitRubberSupply(final RubberSupply model) {
   float z_offset =
       getVisuallyCorrectHeight(model.getPositionX(), model.getPositionY()) + model.getOffsetZ();
   ModelState state = getCachedState(rubber_model_visitor, model, z_offset);
   addToRenderList(state);
   if (!picking && !model.isHit()) default_shadow_renderer.addToShadowList(state);
 }
Exemplo n.º 2
0
 public final void visitSceneryModel(final SceneryModel model) {
   ModelState state = getCachedState(scenery_model_visitor, model);
   addToRenderList(state);
   if (!picking) {
     if (model.getShadowDiameter() > 0f) default_shadow_renderer.addToShadowList(state);
   }
 }
Exemplo n.º 3
0
 private void visitSelectable(
     ModelVisitor visitor,
     Selectable selectable,
     float z_offset,
     float selection_radius,
     float selection_height) {
   boolean in_view =
       !picking
           || (selectable.isEnabled()
               && (visible_override
                   || pickingInFrustum(
                       selectable,
                       camera.getFrustum(),
                       z_offset,
                       selection_radius,
                       selection_height)));
   if (in_view) {
     Player owner = selectable.getOwnerNoCheck();
     boolean point_on_map =
         !local_player.isEnemy(owner)
             || (!owner.teamHasBuilding()
                 && PeerHub.getFreeQuitTimeLeft(local_player.getWorld()) < 0f);
     ModelState state = getCachedState(visitor, selectable, z_offset);
     int sort_status = addToRenderList(state, point_on_map);
     if (!picking && selectable.isEnabled() && sort_status == SpriteSorter.DETAIL_POLYGON) {
       SelectableShadowRenderer shadow_renderer =
           (SelectableShadowRenderer)
               render_queues.getShadowRenderer(
                   selectable.getTemplate().getSelectableShadowRenderer());
       if (isHovered(selectable) || isSelected(selectable)) {
         shadow_renderer.addToSelectionList(state);
       } else {
         shadow_renderer.addToShadowList(state);
       }
     }
   }
 }