import test from "node:test";
import assert from "node:assert/strict";
import { BlockType } from "../../shared/definitions/tiles.js";
import { oreBoulderState } from "../../shared/definitions/materialTiers.js";
import
{
	isChunkAtlasBakedBlock,
	isPickablePlantBlock
} from "../../shared/definitions/tiles.js";

test("ore boulders are not chunk-atlas baked", () =>
{
	assert.equal(isChunkAtlasBakedBlock({
		typeId: BlockType.boulder,
		state: oreBoulderState("copper")
	}), false);
});

test("exhausted plain boulders may be chunk-atlas baked", () =>
{
	assert.equal(isChunkAtlasBakedBlock({
		typeId: BlockType.boulder,
		state: "boulder"
	}), true);
});

test("pickable plants are not chunk-atlas baked", () =>
{
	assert.equal(isPickablePlantBlock({ typeId: BlockType.flower, state: "red" }), true);
	assert.equal(isChunkAtlasBakedBlock({ typeId: BlockType.flower, state: "red" }), false);
});

test("stone walls remain chunk-atlas baked", () =>
{
	assert.equal(isChunkAtlasBakedBlock({ typeId: BlockType.stoneWall }), true);
});

test("runtime campfires are not chunk-atlas baked", () =>
{
	assert.equal(isChunkAtlasBakedBlock({
		typeId: BlockType.campfire,
		state: "pine"
	}), false);
});
