Updated Object Model (markdown)

Azgaar 2021-08-18 00:23:24 +03:00
parent 6be5d9eca0
commit 02dd51c141

@ -2,7 +2,7 @@
FMG exposes all its basic data to the global namespace. The global namespace is getting polluted and it can cause conflicts with 3rd party extensions. But it allows much faster debugging and allows users to run custom JS code to alter the behavior and perform custom changes. So it allows dev console to be used by end-users.
# Basic structure
# Basic objects
FMG has two meta-objects storing most of the map data:
* `grid` contains map data before _repacking_
* `pack` contains map data after _repacking_
@ -42,4 +42,23 @@ Both `grid` and `pack` objects include data representing voronoi diagrams and th
* `pack.vertices`: `{}` - vertices data object, contains only voronoi data:
* * `pack.vertices.p`: `number[][]` - vertices coordinates `[x, y]`, integers
* * `pack.vertices.c`: `number[][]` - indexes of cells adjacent to each vertex, each vertex has 3 adjacent cells
* * `pack.vertices.v`: `number[][]` - indexes of vertices adjacent to each vertex. Most vertices have 3 neighboring vertices, bordering vertices has only 2, while the third is still added to the data as `-1`
* * `pack.vertices.v`: `number[][]` - indexes of vertices adjacent to each vertex. Most vertices have 3 neighboring vertices, bordering vertices has only 2, while the third is still added to the data as `-1`
## Specific cells data
### Grid object
### Grid object
# Secondary pack data
Secondary data available as a part of the `pack` object.
## Cultures
## Burgs
## States
## Provinces
## Religions
## Rivers
## Routes
# Secondary global data
Secondary data exposed to global.
## Notes