Skip to content

Add AddRange support to NetList#30

Closed
Matt9440 wants to merge 2 commits intoFacepunch:masterfrom
Matt9440:netlist-addrange
Closed

Add AddRange support to NetList#30
Matt9440 wants to merge 2 commits intoFacepunch:masterfrom
Matt9440:netlist-addrange

Conversation

@Matt9440
Copy link
Copy Markdown
Contributor

@Matt9440 Matt9440 commented Nov 26, 2025

Old behaviour

[Sync] public NetList<string> MyList { get; set; }

public void OldBehaviour()
{
	var valuesToAdd = new string[] { "thing 1", "thing 2" };

	MyList.ToList().AddRange( valuesToAdd );
}

New behaviour

[Sync] public NetList<string> MyList { get; set; }

public void NewBehaviour()
{
	var valuesToAdd = new string[] { "thing 1", "thing 2" };

	MyList.AddRange( valuesToAdd );
}

Comment thread engine/Sandbox.Engine/Scene/Networking/Containers/NetList.cs Outdated
@garrynewman garrynewman added the triaged triaged pull-requests are replicated on the internal sbox repo label Nov 27, 2025
@handsomematt handsomematt added the accepted this pull request was accepted, hurrah! label Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted this pull request was accepted, hurrah! triaged triaged pull-requests are replicated on the internal sbox repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants