oxiez / CK2-DB

Crusader Kings 2 Database Systems Project Spring 2019
MIT License
13 stars 1 forks source link

Counties don't have historical data in previous #3

Closed Darokrithia closed 5 years ago

Darokrithia commented 5 years ago

So you can't currently see past rulers for counties. They are stored in a more complex data structure (history instead of previous) so we can either just leave it as is or rewrite the load data

oxiez commented 5 years ago

History isn't that complex of a data structure. What we would need to do is form the regex tree as below

hist_sub = {"^holder" : None}
history = {... : ...,
        "^\d+\.\d+\.\d+" : hist_sub
}

You just need to iterate over the dates (the reg keys), make sure they follow the date structure, and see if the hist dict inside contains a holder key.

oxiez commented 5 years ago

Take a look at get_provs.py for an example with baronies.