Require that main body of creature have at least 1 attachment point. (#154)
This fixes #45.pull/160/head
rodzic
1ff17b96c1
commit
b68bc9726f
|
@ -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 = {
|
||||
|
|
Ładowanie…
Reference in New Issue