jaikamat / clubhouse-pos-importer

Monorepo for an LGS's inventory management system
1 stars 0 forks source link

Sale list sort supports Devoid as well as colorless color identities #314

Closed jaikamat closed 3 years ago

jaikamat commented 3 years ago

Summary

The shop sorts cards in the following order when fulfilling orders: ['W', 'U', 'B', 'R', 'G', 'MULTI', 'COLORLESS', 'LAND']

Initially we optimized for Devoid card such as World Breaker, as it does not have a colors array, yet contains a green pip that the shop uses to catalog their physical inventory. Therefore, when we encountered a Devoid card, we fell back to its color_identity rather than its colors.

However the same was true for cards such as Dimir Keyrune, which are colorless by design, yet also have a non-colorless color_identity.

The solution was to check for the keyword of "Devoid" directly.

Now, World Breaker is sorted to green, and Dimir Keyrune is appropriately sorted to colorless.