Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DynamicLevies] 3 title transfer and 1 barony-built on_action handlers that trigger batch-optimized levy law reevaluation #36

Closed
8 tasks done
zijistark opened this issue Jun 16, 2014 · 1 comment
Assignees

Comments

@zijistark
Copy link
Member

In total, only two distinct events need to be written to cover 4 cases of demesne-size change triggers:

  • Handler for on_new_holder_usurpation that, for both ROOT and FROMFROM enqueues a deferred dynlevy.0 event to be executed upon the next day if and only if not = { has_character_flag = dynlevy_dirty }. If not dynlevy_dirty, then it also marks dynlevy_dirty. This is a massive batch title transfer (common in CBs and inheritances) optimization
  • Event trigger for above handler ensures FROMFROM is_alive = yes (makes sense, but also, it allows the event to be used for on_new_holder for filtering grants vs. creates)
  • Event trigger for above handler ensures FROMFROM != ROOT
  • Handler for on_new_holder_inheritance that does exactly the same thing, except that it only operates upon ROOT (FROMFROM is dead momentarily anyhow, if not already-- or abdicated).
  • Handler on on_new_holder barony-built case that does exactly the same thing as the inheritance handler, so they should be the same event
  • Handler for on_new_holder structured exactly like on_new_holder_usurpation. Therefore, use the same event registered on both on_actions. This case happens to magically cover grants
  • Modify dynlevy.0 codegen to clr_character_flag = dynlevy_dirty when finished
  • In all cases of preparing to trigger a levy-law reevaluation for a scope in these 2 events (for 6 total cases), also do the full dirty-flag-check, conditional-event-enqueue sequence for any_liege of the scoped character.
@zijistark zijistark added this to the DynamicLeviesImplementation milestone Jun 16, 2014
@zijistark zijistark self-assigned this Jun 16, 2014
@zijistark zijistark changed the title [DynamicLevies] on_new_holder_usurpation/inheritance handlers for levy law reevaluation [DynamicLevies] 3 title transfer on_action handlers that trigger batch-optimized levy law reevaluation Jun 16, 2014
@zijistark zijistark changed the title [DynamicLevies] 3 title transfer on_action handlers that trigger batch-optimized levy law reevaluation [DynamicLevies] 3 title transfer and 1 barony-built on_action handlers that trigger batch-optimized levy law reevaluation Jun 17, 2014
@zijistark
Copy link
Member Author

Ended-up splitting these 2 planned similar events into 3 ultra-similar events to be sure about avoiding unnecessary triggering due to listening to multiple types of on_actions. All written under the assumption that FROMFROM is bound properly (it isn't yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant