landlord-ts 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.cjs +4 -0
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1945,6 +1945,9 @@ var RunValidationError = class extends Error {
|
|
|
1945
1945
|
this.name = "RunValidationError";
|
|
1946
1946
|
}
|
|
1947
1947
|
};
|
|
1948
|
+
function producedManaFrom(cost) {
|
|
1949
|
+
return { w: cost.w, u: cost.u, b: cost.b, r: cost.r, g: cost.g, c: cost.c };
|
|
1950
|
+
}
|
|
1948
1951
|
function emptyLandCounts() {
|
|
1949
1952
|
return {
|
|
1950
1953
|
totalLandCounts: newManaColorCount(),
|
|
@@ -2062,6 +2065,7 @@ function simulationToOutput(deck, sim) {
|
|
|
2062
2065
|
outputs.landCounts = deckIter(deck).filter((c) => isLand(c.card)).map((c) => ({
|
|
2063
2066
|
name: c.card.name,
|
|
2064
2067
|
manaCost: c.card.manaCostString,
|
|
2068
|
+
producedMana: producedManaFrom(c.card.manaCost),
|
|
2065
2069
|
imageUri: c.card.imageUri,
|
|
2066
2070
|
kind: c.card.kind,
|
|
2067
2071
|
copies: c.count,
|
package/dist/index.d.cts
CHANGED
|
@@ -361,9 +361,13 @@ type RunAsyncInput = RunInput & {
|
|
|
361
361
|
/** When aborted, stops between batches (throws `AbortError`). */
|
|
362
362
|
signal?: AbortSignal;
|
|
363
363
|
};
|
|
364
|
+
type ProducedMana = Pick<ManaCost, 'w' | 'u' | 'b' | 'r' | 'g' | 'c'>;
|
|
364
365
|
type LandCount = {
|
|
365
366
|
name: string;
|
|
367
|
+
/** Casting cost string (empty for most lands). Prefer `producedMana` for mana-source UI. */
|
|
366
368
|
manaCost: string;
|
|
369
|
+
/** Colors this land can produce when tapped (0/1 flags per color). */
|
|
370
|
+
producedMana: ProducedMana;
|
|
367
371
|
imageUri: string;
|
|
368
372
|
kind: CardKind;
|
|
369
373
|
copies: number;
|
|
@@ -501,4 +505,4 @@ type Never = {
|
|
|
501
505
|
};
|
|
502
506
|
declare function asNeverMulligan(n?: Never): Mulligan;
|
|
503
507
|
|
|
504
|
-
export { ALL_CARDS, BasicLandType, COLOR_CONSTRAINED_THRESHOLD, type Card, CardKind, type CardObservationsReport, type ColorConstrainedEntry, DRAW_DEPENDENT_THRESHOLD, type Deck, type DeckCard, DeckcodeError, type DrawDependentEntry, type LandCount, type ManaColorCount, type ManaCost, type Observations, type ParseDecklistResult, PlayOrder, Rarity, type RunAsyncInput, type RunInput, type RunOutput, type RunProgress, type RunProgressPhase, RunValidationError, SPECIAL_LANDS, type ScryfallCard, type SimulateDoneEvent, type SimulateErrorEvent, type SimulateProgressEvent, type SimulateStreamEvent, type Simulation, type SimulationAsyncOptions, type SimulationProgress, type WeakestOnCurveEntry, asLondonMulligan, asNeverMulligan, autoTapByTurn, availableTurnForLand, basicLandTypesFromTypeLine, checkTypesFromOracleText, createMulberry32, deckFlatten, deckFromCards, deckFromList, decklist, drawCmcAutoTap, etbClauseFromOracle, getAllCards, handFromOpeningAndDraws, hashCardName, isLand, isLandKind, landKindFromOracleText, loadCardsFromGzipBytes, londonNever, manaCostCmc, manaCostFromRgbuwc, manaCostsFromStr, observationsForCard, pMana, pManaGivenCmc, pPlay, parseDecklist, playCmcAutoTap, run, runAsync, scryfallCardToCard, scryfallCardsToCards, setAllCards, simulationFromConfig, simulationFromConfigAsync, wilsonHalfWidth };
|
|
508
|
+
export { ALL_CARDS, BasicLandType, COLOR_CONSTRAINED_THRESHOLD, type Card, CardKind, type CardObservationsReport, type ColorConstrainedEntry, DRAW_DEPENDENT_THRESHOLD, type Deck, type DeckCard, DeckcodeError, type DrawDependentEntry, type LandCount, type ManaColorCount, type ManaCost, type Observations, type ParseDecklistResult, PlayOrder, type ProducedMana, Rarity, type RunAsyncInput, type RunInput, type RunOutput, type RunProgress, type RunProgressPhase, RunValidationError, SPECIAL_LANDS, type ScryfallCard, type SimulateDoneEvent, type SimulateErrorEvent, type SimulateProgressEvent, type SimulateStreamEvent, type Simulation, type SimulationAsyncOptions, type SimulationProgress, type WeakestOnCurveEntry, asLondonMulligan, asNeverMulligan, autoTapByTurn, availableTurnForLand, basicLandTypesFromTypeLine, checkTypesFromOracleText, createMulberry32, deckFlatten, deckFromCards, deckFromList, decklist, drawCmcAutoTap, etbClauseFromOracle, getAllCards, handFromOpeningAndDraws, hashCardName, isLand, isLandKind, landKindFromOracleText, loadCardsFromGzipBytes, londonNever, manaCostCmc, manaCostFromRgbuwc, manaCostsFromStr, observationsForCard, pMana, pManaGivenCmc, pPlay, parseDecklist, playCmcAutoTap, run, runAsync, scryfallCardToCard, scryfallCardsToCards, setAllCards, simulationFromConfig, simulationFromConfigAsync, wilsonHalfWidth };
|
package/dist/index.d.ts
CHANGED
|
@@ -361,9 +361,13 @@ type RunAsyncInput = RunInput & {
|
|
|
361
361
|
/** When aborted, stops between batches (throws `AbortError`). */
|
|
362
362
|
signal?: AbortSignal;
|
|
363
363
|
};
|
|
364
|
+
type ProducedMana = Pick<ManaCost, 'w' | 'u' | 'b' | 'r' | 'g' | 'c'>;
|
|
364
365
|
type LandCount = {
|
|
365
366
|
name: string;
|
|
367
|
+
/** Casting cost string (empty for most lands). Prefer `producedMana` for mana-source UI. */
|
|
366
368
|
manaCost: string;
|
|
369
|
+
/** Colors this land can produce when tapped (0/1 flags per color). */
|
|
370
|
+
producedMana: ProducedMana;
|
|
367
371
|
imageUri: string;
|
|
368
372
|
kind: CardKind;
|
|
369
373
|
copies: number;
|
|
@@ -501,4 +505,4 @@ type Never = {
|
|
|
501
505
|
};
|
|
502
506
|
declare function asNeverMulligan(n?: Never): Mulligan;
|
|
503
507
|
|
|
504
|
-
export { ALL_CARDS, BasicLandType, COLOR_CONSTRAINED_THRESHOLD, type Card, CardKind, type CardObservationsReport, type ColorConstrainedEntry, DRAW_DEPENDENT_THRESHOLD, type Deck, type DeckCard, DeckcodeError, type DrawDependentEntry, type LandCount, type ManaColorCount, type ManaCost, type Observations, type ParseDecklistResult, PlayOrder, Rarity, type RunAsyncInput, type RunInput, type RunOutput, type RunProgress, type RunProgressPhase, RunValidationError, SPECIAL_LANDS, type ScryfallCard, type SimulateDoneEvent, type SimulateErrorEvent, type SimulateProgressEvent, type SimulateStreamEvent, type Simulation, type SimulationAsyncOptions, type SimulationProgress, type WeakestOnCurveEntry, asLondonMulligan, asNeverMulligan, autoTapByTurn, availableTurnForLand, basicLandTypesFromTypeLine, checkTypesFromOracleText, createMulberry32, deckFlatten, deckFromCards, deckFromList, decklist, drawCmcAutoTap, etbClauseFromOracle, getAllCards, handFromOpeningAndDraws, hashCardName, isLand, isLandKind, landKindFromOracleText, loadCardsFromGzipBytes, londonNever, manaCostCmc, manaCostFromRgbuwc, manaCostsFromStr, observationsForCard, pMana, pManaGivenCmc, pPlay, parseDecklist, playCmcAutoTap, run, runAsync, scryfallCardToCard, scryfallCardsToCards, setAllCards, simulationFromConfig, simulationFromConfigAsync, wilsonHalfWidth };
|
|
508
|
+
export { ALL_CARDS, BasicLandType, COLOR_CONSTRAINED_THRESHOLD, type Card, CardKind, type CardObservationsReport, type ColorConstrainedEntry, DRAW_DEPENDENT_THRESHOLD, type Deck, type DeckCard, DeckcodeError, type DrawDependentEntry, type LandCount, type ManaColorCount, type ManaCost, type Observations, type ParseDecklistResult, PlayOrder, type ProducedMana, Rarity, type RunAsyncInput, type RunInput, type RunOutput, type RunProgress, type RunProgressPhase, RunValidationError, SPECIAL_LANDS, type ScryfallCard, type SimulateDoneEvent, type SimulateErrorEvent, type SimulateProgressEvent, type SimulateStreamEvent, type Simulation, type SimulationAsyncOptions, type SimulationProgress, type WeakestOnCurveEntry, asLondonMulligan, asNeverMulligan, autoTapByTurn, availableTurnForLand, basicLandTypesFromTypeLine, checkTypesFromOracleText, createMulberry32, deckFlatten, deckFromCards, deckFromList, decklist, drawCmcAutoTap, etbClauseFromOracle, getAllCards, handFromOpeningAndDraws, hashCardName, isLand, isLandKind, landKindFromOracleText, loadCardsFromGzipBytes, londonNever, manaCostCmc, manaCostFromRgbuwc, manaCostsFromStr, observationsForCard, pMana, pManaGivenCmc, pPlay, parseDecklist, playCmcAutoTap, run, runAsync, scryfallCardToCard, scryfallCardsToCards, setAllCards, simulationFromConfig, simulationFromConfigAsync, wilsonHalfWidth };
|
package/dist/index.js
CHANGED
|
@@ -1140,6 +1140,9 @@ var RunValidationError = class extends Error {
|
|
|
1140
1140
|
this.name = "RunValidationError";
|
|
1141
1141
|
}
|
|
1142
1142
|
};
|
|
1143
|
+
function producedManaFrom(cost) {
|
|
1144
|
+
return { w: cost.w, u: cost.u, b: cost.b, r: cost.r, g: cost.g, c: cost.c };
|
|
1145
|
+
}
|
|
1143
1146
|
function emptyLandCounts() {
|
|
1144
1147
|
return {
|
|
1145
1148
|
totalLandCounts: newManaColorCount(),
|
|
@@ -1257,6 +1260,7 @@ function simulationToOutput(deck, sim) {
|
|
|
1257
1260
|
outputs.landCounts = deckIter(deck).filter((c) => isLand(c.card)).map((c) => ({
|
|
1258
1261
|
name: c.card.name,
|
|
1259
1262
|
manaCost: c.card.manaCostString,
|
|
1263
|
+
producedMana: producedManaFrom(c.card.manaCost),
|
|
1260
1264
|
imageUri: c.card.imageUri,
|
|
1261
1265
|
kind: c.card.kind,
|
|
1262
1266
|
copies: c.count,
|