@Test public void testGetFrames_Horizontal_HappyPath_ConstructorB() { spriteSheet = new AnimationSpriteSheet( texture, TEXTURE_SIZE / TILE_SIZE, TEXTURE_SIZE / TILE_SIZE ); TextureRegion[] regions = spriteSheet.getFrames(0, 0, 7, 0); assertThat(regions.length).isEqualTo(8); regions = spriteSheet.getFrames(0, 0, 7, 7); assertThat(regions.length).isEqualTo(64); }
public TextureRegion[] getFrames(int startX, int startY, int endX, int endY) { String cacheKey = getCacheKey(startX, startY, endX, endY); TextureRegion[] cachedData = textureRegionCache.get(cacheKey); if (cachedData == null) { cachedData = computeCacheData(startX, startY, endX, endY); textureRegionCache.put(cacheKey, cachedData); } return cachedData; }
AnimationSpriteSheet { public TextureRegion[] getFrames(int startX, int startY, int endX, int endY) { String cacheKey = getCacheKey(startX, startY, endX, endY); TextureRegion[] cachedData = textureRegionCache.get(cacheKey); if (cachedData == null) { cachedData = computeCacheData(startX, startY, endX, endY); textureRegionCache.put(cacheKey, cachedData); } return cachedData; } }
AnimationSpriteSheet { public TextureRegion[] getFrames(int startX, int startY, int endX, int endY) { String cacheKey = getCacheKey(startX, startY, endX, endY); TextureRegion[] cachedData = textureRegionCache.get(cacheKey); if (cachedData == null) { cachedData = computeCacheData(startX, startY, endX, endY); textureRegionCache.put(cacheKey, cachedData); } return cachedData; } AnimationSpriteSheet(String assetId, int tileSize);  AnimationSpriteSheet(String assetId, int tileWidth, int tileHeight);  AnimationSpriteSheet(Texture texture, int tileSize);  AnimationSpriteSheet(Texture texture, int tileWidth, int tileHeight); }
AnimationSpriteSheet { public TextureRegion[] getFrames(int startX, int startY, int endX, int endY) { String cacheKey = getCacheKey(startX, startY, endX, endY); TextureRegion[] cachedData = textureRegionCache.get(cacheKey); if (cachedData == null) { cachedData = computeCacheData(startX, startY, endX, endY); textureRegionCache.put(cacheKey, cachedData); } return cachedData; } AnimationSpriteSheet(String assetId, int tileSize);  AnimationSpriteSheet(String assetId, int tileWidth, int tileHeight);  AnimationSpriteSheet(Texture texture, int tileSize);  AnimationSpriteSheet(Texture texture, int tileWidth, int tileHeight); TextureRegion[] getFrames(int startX, int startY, int endX, int endY); }
AnimationSpriteSheet { public TextureRegion[] getFrames(int startX, int startY, int endX, int endY) { String cacheKey = getCacheKey(startX, startY, endX, endY); TextureRegion[] cachedData = textureRegionCache.get(cacheKey); if (cachedData == null) { cachedData = computeCacheData(startX, startY, endX, endY); textureRegionCache.put(cacheKey, cachedData); } return cachedData; } AnimationSpriteSheet(String assetId, int tileSize);  AnimationSpriteSheet(String assetId, int tileWidth, int tileHeight);  AnimationSpriteSheet(Texture texture, int tileSize);  AnimationSpriteSheet(Texture texture, int tileWidth, int tileHeight); TextureRegion[] getFrames(int startX, int startY, int endX, int endY);  }