johnameyer / cards-ts

A card game framework and various games in Typescript. The framework allows for bot development and playing card games in the terminal or in a browser.
6 stars 2 forks source link

Add toObj and fromObj to StateTransformer #65

Closed johnameyer closed 3 years ago

johnameyer commented 3 years ago

Since most of the state transformers just use JSON stringify and parse under the hood, we can move that up to the parent class and have children only override to/fromObj.

johnameyer commented 3 years ago

With #63, there shouldn't be a need for this at all, preferring serializeSerializable (aliases JSON.stringify) and deserializeSerializable