Require that main body of creature have at least 1 attachment point. (#154)

This fixes #45.
pull/160/head
Atul Varma 2021-06-07 08:01:11 -04:00 zatwierdzone przez GitHub
rodzic 1ff17b96c1
commit b68bc9726f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 12 dodań i 1 usunięć

Wyświetl plik

@ -33,9 +33,20 @@ import { Page } from "../page";
import { RandomizerWidget } from "../randomizer-widget";
import { VocabularyWidget } from "../vocabulary-widget";
/**
* The minimum number of attachment points that any symbol used as the main body
* of a creature must have.
*
* Note that this number is inclusive of a symbol's anchor point.
*/
const MIN_ROOT_ATTACHMENT_POINTS = 2;
/** Symbols that can be the "root" (i.e., main body) of a creature. */
const ROOT_SYMBOLS = SvgVocabulary.items.filter(
(data) => data.meta?.always_be_nested !== true
(data) =>
data.meta?.always_be_nested !== true &&
Array.from(iterAttachmentPoints(data.specs || {})).length >=
MIN_ROOT_ATTACHMENT_POINTS
);
type AttachmentSymbolMap = {