Ledenel / auto-white-reimu

a mahjong library aimed to implement mahjong AIs by imitating white reimu -- a excellent mahjong player.
GNU General Public License v3.0
9 stars 1 forks source link

Add explanation to the TenhouRecord.game_list.events #13

Closed canuse closed 5 years ago

canuse commented 5 years ago

The current format of element 'event', which is like 'D70', 'U128'... , is quite hard to understand. It might be more readable if there is an explanation, namely 'deal 1s', 'discard 1s'.

Ledenel commented 5 years ago

Now the element 'event' is just plain XML Element parsed by native Python library xml.etree.ElementTree .

for better representation, we could:

  1. add a wrapper, somthing like TenhouEvent for the XML Element.
  2. in TenhouEvent delegate everything to thet real XML Element.
  3. add some helper function and represention like __str__ and __repr__.
  4. hack this point to ensure wrap any XML Element to TenhouEvent.
Ledenel commented 5 years ago

Would be something like this:

image

Ledenel commented 5 years ago

implemented at #15 .