Skip to content

Eliminate all static variables and methods #211

@VictorPhilipp

Description

@VictorPhilipp

As a developer I want my application to be hot-swappable to allow for a faster development time.

Assumptions/Preconditions

  • Static variables and methods prevent the mod from being modified and updated while the game is running: C:S cannot fully unload old instances.
  • Other features relevant for hot-swappability, like loading/saving custom data or deployment/removal of method detours are triggered at specific OnLoad/OnUnload events.

Tasks

  • Remove as many static fields/methods as possible. Convert them into instance-level members.
  • If not everything can be converted, collect remaining members and put them at a central place.
  • Extend OnLoad/OnUnload event handlers such they take care that any remaining static members are unset/set.
  • Check if the mod can be hot-swapped. If any further problems arise that were not foreseen create an issue on GitHub.

Acceptance criteria

  • Static members are gone, except for a limited amount
    • Remaining static members are instantiated/invalidated at mod loading/unloading time
  • Mod functionality remains unchanged
  • Mod loading/unloading still works

Metadata

Metadata

Assignees

No one assigned

    Labels

    EXTERNALMod conflict or other external factorout of scopeNot applicable to TM:PE or should be separate mod

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions