Skip to content

Simplify D2Selection lobby option initialization #238

Description

@evgeniysergeev

D2Selection currently stores world and info, then lazily initializes SingleSelection through an initialized flag in Add and Combine.

This appears unnecessary: D2Selection is a world trait, and world.LobbyInfo.GlobalSettings is already available when the trait is constructed. The singleselection lobby option can be read directly in the constructor.

Suggested cleanup:

public D2Selection(World world, D2SelectionInfo info)
{
	SingleSelection = world.LobbyInfo.GlobalSettings.OptionOrDefault("singleselection", info.CheckboxEnabled);
}

Then remove:

  • readonly D2SelectionInfo info
  • readonly World world
  • bool initialized
  • Init()
  • Init() calls from Add and Combine

Acceptance criteria:

  • Single-selection behavior remains unchanged.
  • The singleselection lobby option still controls SingleSelection.
  • No unnecessary lazy initialization state remains in D2Selection.
  • Project builds successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions