Python Forum
Variable sorting methods for Enum DataClasses
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable sorting methods for Enum DataClasses
#2
As you noted in your post, cards do not have an intrinsic value. The value of a card is determined by the card game. I would have the card game assign a value to the cards that is used for comparison. You can default this value to the rank, but the card game can change the value.

What is your plan for aces? These can be the highest or lowest value card in some games, and which is decided by the game, not the card.
Reply


Messages In This Thread
RE: Variable sorting methods for Enum DataClasses - by deanhystad - May-30-2023, 07:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Alarm system with state, class, enum. Frankduc 0 1,313 May-04-2022, 01:26 PM
Last Post: Frankduc
Question Having trouble writing an Enum with a custom __new__ method stevendaprano 3 4,293 Feb-13-2022, 06:37 AM
Last Post: deanhystad
  Enum help SephMon 3 1,548 Nov-19-2021, 09:39 AM
Last Post: Yoriz
  Sorting a copied list is also sorting the original list ? SN_YAZER 3 3,154 Apr-11-2019, 05:10 PM
Last Post: SN_YAZER
  enum from typelib Erhy 2 2,192 Jan-26-2019, 05:37 PM
Last Post: Erhy
  Python error? Enum and strings tycarac 3 3,626 Dec-15-2018, 10:39 AM
Last Post: tycarac

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020