Android Open Source - block-composer Level Mask






From Project

Back to project page block-composer.

License

The source code is released under:

MIT License

If you think the Android project block-composer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package bwr.blockcomposer.gamedata;
//w ww.  j av  a 2s.c  om
import java.util.Arrays;

import bwr.blockcomposer.types.IntVector;

public class LevelMask {
  
  private final boolean[][][] mask;
  
  private final LevelDimensions dimensions;
  
  public LevelMask(LevelDimensions dimensions) {
    this.dimensions = dimensions;
    mask = new boolean[dimensions.getSizeX()][dimensions.getSizeY()][dimensions.getSizeZ()];
  }
  
  public void setMaskAt(IntVector location, boolean value) {
    if(dimensions.isOnLevel(location)) {
      IntVector arrayLocation = dimensions.mapToArrayCoords(location);
      mask[arrayLocation.x][arrayLocation.y][arrayLocation.z] = value;
    }
  }
  
  public boolean getMaskAt(IntVector location) {
    if(dimensions.isOnLevel(location)) {
      IntVector arrayLocation = dimensions.mapToArrayCoords(location);
      return mask[arrayLocation.x][arrayLocation.y][arrayLocation.z];
    }
    return false; // TODO: throw exception
  }
  
  public void clear() {
      for(int i = 0; i < mask.length; i++) {
        for(int j=0; j < mask[i].length; j++) {
          Arrays.fill(mask[i][j], false);
        }
      }
  }
}




Java Source Code List

bwr.blockcomposer.AnimationFinishedListener.java
bwr.blockcomposer.BlockComposerActivity.java
bwr.blockcomposer.BlockComposerRenderer.java
bwr.blockcomposer.BlockComposer.java
bwr.blockcomposer.Camera.java
bwr.blockcomposer.GameResources.java
bwr.blockcomposer.OnUpdateAction.java
bwr.blockcomposer.gamedata.Block.java
bwr.blockcomposer.gamedata.GameEntity.java
bwr.blockcomposer.gamedata.GameState.java
bwr.blockcomposer.gamedata.LevelDimensions.java
bwr.blockcomposer.gamedata.LevelMask.java
bwr.blockcomposer.gamedata.LevelMetadata.java
bwr.blockcomposer.gamedata.LevelStore.java
bwr.blockcomposer.gamedata.Level.java
bwr.blockcomposer.gamedata.Move.java
bwr.blockcomposer.gamedata.StaticLevelStore.java
bwr.blockcomposer.gamedata.UserLevelStore.java
bwr.blockcomposer.misc.GLUtility.java
bwr.blockcomposer.misc.Timer.java
bwr.blockcomposer.models.AxisRenderer.java
bwr.blockcomposer.models.Model.java
bwr.blockcomposer.models.SelectBoxRenderer.java
bwr.blockcomposer.modes.EditMode.java
bwr.blockcomposer.modes.GameDialogMode.java
bwr.blockcomposer.modes.GameMode.java
bwr.blockcomposer.modes.LevelImportMode.java
bwr.blockcomposer.modes.LevelSelectMode.java
bwr.blockcomposer.modes.LogoDisplayMode.java
bwr.blockcomposer.modes.ModeController.java
bwr.blockcomposer.modes.Mode.java
bwr.blockcomposer.modes.OverlayMode.java
bwr.blockcomposer.types.FlipRotateFloat.java
bwr.blockcomposer.types.FloatValueVector3.java
bwr.blockcomposer.types.FloatValue.java
bwr.blockcomposer.types.IntVector.java
bwr.blockcomposer.types.RotatingFloat.java
bwr.blockcomposer.ui.TextRenderer.java
bwr.blockcomposer.ui.UIElementPicture.java
bwr.blockcomposer.ui.UIElementText.java
bwr.blockcomposer.ui.UIElement.java