export const CoveredCellSchema = Schema.Struct({
revealed: Schema.Literal(false),
flagged: Schema.Literal(false),
live: Schema.Boolean,
adjacents: Schema.Number,
});
export const CoveredClearCellSchema = Schema.Struct({
// similar
});
export const CoveredLiveCellSchema = Schema.Struct({
// similar
});
type CoveredCell = Schema.Schema.Type<typeof CoveredCellSchema>;
type CoveredClearCell = Schema.Schema.Type<
typeof CoveredClearCellSchema
>;
type CoveredLiveCell = Schema.Schema.Type<typeof CoveredLiveSchema>;
// These two types represent the possible permutations of CoveredCell, so this match would be exhaustive.
const match = Match.type<CoveredCell>().pipe(
Match.when(CoveredClearCell, (c) => ...),
Match.when(CoveredLiveCell, (c) => ...),
Match.exhaustive
);
export const CoveredCellSchema = Schema.Struct({
revealed: Schema.Literal(false),
flagged: Schema.Literal(false),
live: Schema.Boolean,
adjacents: Schema.Number,
});
export const CoveredClearCellSchema = Schema.Struct({
// similar
});
export const CoveredLiveCellSchema = Schema.Struct({
// similar
});
type CoveredCell = Schema.Schema.Type<typeof CoveredCellSchema>;
type CoveredClearCell = Schema.Schema.Type<
typeof CoveredClearCellSchema
>;
type CoveredLiveCell = Schema.Schema.Type<typeof CoveredLiveSchema>;
// These two types represent the possible permutations of CoveredCell, so this match would be exhaustive.
const match = Match.type<CoveredCell>().pipe(
Match.when(CoveredClearCell, (c) => ...),
Match.when(CoveredLiveCell, (c) => ...),
Match.exhaustive
);