CAGridComponents extends Component { public long stampState(final int[][] pattern, final int row, final int col) { if (row > -1 && col > -1 && row < states.length - pattern.length && col < states[0].length - pattern[0].length) { _stampState(pattern, row, col); stampCount++; return TIME_BTWN_GENERATIONS; } else { return -1; } }  int getState(Vector2 pos); int getState(final int row, final int col); int getLastState(final int row, final int col); void init(Camera camera); float getXOrigin(Camera camera); float getYOrigin(Camera camera); BaseCell newCell(int init_state); int getIndexOfX(float x); int getIndexOfY(float y); Vector2 getPositionOf(final int x, final int y); long stampCenteredAt(final int[][] pattern, Vector2 position); long stampState(final int[][] pattern, final int row, final int col); void setState(final int row, final int col, final int newVal); String statesToString(int x, int y, int w, int h); String statesToString(); void fill(int state); public long TIME_BTWN_GENERATIONS; final float SCALE; public float gridOriginX; public float gridOriginY; public long minGenTime; public long maxGenTime; public CellType cellType; public CellRenderer renderType; public CA ca; public int intensityPerCell; public BaseCell[][] states; public int cellSize; public int cellCount; public CAEdgeSpawnType edgeSpawner; public Color[] stateColorMap; public long generation; public int lastBuilderStamp; }
@Test public void testStampBlock() { Camera camera = new Camera() { @Override public void update() { } @Override public void update(boolean updateFrustum) { } }; CAGridComponents testComps = new CAGridComponents(); CALayerBuilder.initLayerComponentsByType(testComps, CALayer.VYROIDS, camera); CAGenerationSystem testSystem = new CAGenerationSystem(); testSystem._inserted(testComps, false, 0); testComps.stampState(CGoLShapeConsts.BLOCK, 0, 0); assert testUtils.ifStatesMatchAt(testComps, CGoLShapeConsts.BLOCK, 0, 0); }