# Class StreamingTerrain.MemoryChunkProvider

java.lang.Object
com.codename1.gaming.level.StreamingTerrain.MemoryChunkProvider

All Implemented Interfaces:
  `ChunkProvider`

Enclosing class:
  `StreamingTerrain`

public static final class StreamingTerrain.MemoryChunkProvider extends Object implements ChunkProvider
A trivial in-memory provider: remembers chunks it has seen, generates empty flat-grass chunks otherwise. Useful as a default and for tests.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MemoryChunkProvider()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TerrainChunk`
  `loadChunk(int cx, int cz)`
  Loads (or generates) the chunk at the given chunk coordinates.
  `void`
  `saveChunk(TerrainChunk chunk)`
  Persists a dirty chunk being evicted from memory.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### MemoryChunkProvider

    public MemoryChunkProvider()

- ## Method Details

  - ### loadChunk

    public TerrainChunk loadChunk(int cx, int cz)
    Description copied from interface: `ChunkProvider`
    Loads (or generates) the chunk at the given chunk coordinates. Never returns null.
    Specified by:
      `loadChunk` in interface `ChunkProvider`

  - ### saveChunk

    public void saveChunk(TerrainChunk chunk)
    Description copied from interface: `ChunkProvider`
    Persists a dirty chunk being evicted from memory. No-op for read-only/procedural sources.
    Specified by:
      `saveChunk` in interface `ChunkProvider`