swarm/src
Karl Ostmo 936b30d22a
extensible terrain (#1775)
Closes #1641

The `data/terrain.yaml` file is now the authoritative source of terrains, though `BlankT` is still a hard-coded special case.

I have not changed the underlying integer representation of terrain in the world function, which means that the `terrainIndexByName` Map in the `TerrainMap` record is needed for translating between `Int` and `TerrainType`.

# Demo

    scripts/play.sh -i data/scenarios/Testing/1775-custom-terrain.yaml

![Screenshot from 2024-02-22 16-51-53](https://github.com/swarm-game/swarm/assets/261693/1d263c8b-4e9c-40bf-bdc8-bf5ba8e33c4d)

# Changes

* There used to be a function called `integrateScenarioEntities` that combined the `EntityMap` stored in the `Scenario` record with the global entity map.  However, the global entity map is accessible at parse time of the `Scenario`, so we do the combining there and only ever store the combined map in the `Scenario` record.
* JSON Schema for terrain
* Removed the distinction between "World" attributes and "Terrain" attributes
* Unit tests for scenario-defined terrain and related validations
    * Validate existence of referenced terrain at scenario parse time
    * Validate attributes referenced by terrains at parse time
2024-02-29 06:22:21 +00:00
..
Swarm extensible terrain (#1775) 2024-02-29 06:22:21 +00:00
swarm-engine/Swarm extensible terrain (#1775) 2024-02-29 06:22:21 +00:00
swarm-lang/Swarm/Language Update to depend on lsp-2.4.0.0 (#1762) 2024-02-12 11:05:39 -06:00
swarm-scenario/Swarm extensible terrain (#1775) 2024-02-29 06:22:21 +00:00
swarm-util extensible terrain (#1775) 2024-02-29 06:22:21 +00:00
swarm-web/Swarm decompose scenario record (#1771) 2024-02-19 19:53:43 +00:00