Added Property-Parameter to SkillSelectOptionCategoryPrerequisite#175
Conversation
There was a problem hiding this comment.
Eine Möglichkeit wäre, hier statt einem einfachen SpellIdentifier ein Enum zu übergeben, wo man entweder einen konkreten Zauber oder ein Merkmal auswählen muss. Und das dann auch analog für Rituale.
| const GenericSkillsSelectOptionCategoryCategory = DB.GenTypeAlias(import.meta.url, { | ||
| name: "GenericSkillsSelectOptionCategoryCategory", | ||
| parameters: [DB.Param("Ref")], | ||
| type: Ref => | ||
| DB.Object({ | ||
| specific: DB.Optional({ | ||
| comment: "Only include (`Intersection`) or exclude (`Difference`) specific entries.", | ||
| type: DB.GenIncludeIdentifier(SpecificFromSkillSelectOptionCategoryCategory, [ | ||
| DB.TypeArgument(Ref), | ||
| ]), | ||
| }), | ||
| prerequisites: DB.Optional({ | ||
| comment: "Generate prerequisites for each entry of the category.", | ||
| type: DB.Array(DB.IncludeIdentifier(SkillSelectOptionCategoryPrerequisite), { | ||
| minItems: 1, | ||
| }), | ||
| }), | ||
| }), | ||
| }) |
There was a problem hiding this comment.
Eine andere Möglichkeit wäre, diesen Typ zu duplizieren und einen neuen Key properties oder so einzufügen, wo man neben bestimmten Zaubern in specific auch bestimmte Merkmale auflisten kann.
| values: () => ({ | ||
| Self: DB.EnumCase({ type: DB.IncludeIdentifier(SelfPrerequisite) }), | ||
| SelectOption: DB.EnumCase({ type: DB.IncludeIdentifier(OptionPrerequisite) }), | ||
| Property: DB.EnumCase({ type: DB.IncludeIdentifier(PropertyPrerequisite) }), |
There was a problem hiding this comment.
Das hier würde so nicht gehen, da das eine Voraussetzung für die jeweilige Auswahloption generieren würde. Also man bräuchte dann quasi ein Merkmal, um den Zauber wählen zu können. Aber was hieße „ein Merkmal brauchen“? Merkmalskenntnis? Also Voraussetzungen beziehen sich ja immer auf etwas, was ein Charakter hat, nicht auf etwas, was ein Eintrag im Buch hat.
…eter with specific identifiers or a property
|
Variante 1 umgesetzt. Nochmal drüberschauen bitte. |
elyukai
left a comment
There was a problem hiding this comment.
Ansonsten finde ich es gut so!
| const SpellFilter = DB.Enum(import.meta.url, { | ||
| name: "SpellFilter", | ||
| values: () => ({ | ||
| Identifier: DB.EnumCase({ type: SpellIdentifier() }), | ||
| Property: DB.EnumCase({ type: PropertyIdentifier() }), | ||
| }), | ||
| }) | ||
|
|
||
| const RitualFilter = DB.Enum(import.meta.url, { | ||
| name: "RitualFilter", | ||
| values: () => ({ | ||
| Identifier: DB.EnumCase({ type: RitualIdentifier() }), | ||
| Property: DB.EnumCase({ type: PropertyIdentifier() }), | ||
| }), | ||
| }) | ||
|
|
There was a problem hiding this comment.
Ich würde Identifier vielleicht eher Single oder so nennen, da ja auch die Property ein Identifier ist.
|
Anmerkungen umgesetzt! |
| export const PropertyPrerequisite = DB.TypeAlias(import.meta.url, { | ||
| name: "PropertyPrerequisite", | ||
| comment: "Requires a specific property or one of a specific set of properties.", | ||
| type: () => | ||
| DB.Object({ | ||
| id: DB.Required({ | ||
| comment: "The property�s identifier.", | ||
| type: PropertyIdentifier(), | ||
| }), | ||
| display_option: DB.Optional({ | ||
| type: DB.IncludeIdentifier(DisplayOption), | ||
| }), | ||
| }), | ||
| }) |
There was a problem hiding this comment.
Ich schätze mal, dass hier die Einrückung nicht passt und er deswegen meckert.
Closes #174
Kann man das so machen? Ich bekomme auch hier Kompilierungsfehler und brauch ein wenig Hilfe