question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handful of `Dictionary`s somewhere to centralize "entity group" storage (one for each `Entity` type)

See original GitHub issue

Description

See title. That would literally be as simple as something like:

public class ModContent {
	private static IDictionary<string, IReadOnlyList<int>> _ItemGroups;
	public static IReadOnlyDictionary<string, IReadOnlyList<int>> ItemGroups { get; private set; }

	static ModContent() {
		_ItemGroups = new ConcurrentDictionary<string, IReadOnlyList<int>>();
		ItemGroups = new ReadOnlyDictionary<string, IReadOnlyList<int>>( _ItemGroups );
	}

	public static void AddToItemGroup( string groupName, IEnumerable<int> group ) {
		if( !_ItemGroups.ContainsKey( groupName ) ) {
			_ItemGroups[groupName] = group.ToList().AsReadOnly();
		} else {
			_ItemGroups[groupName] = _ItemGroups[groupName].Union( group ).ToList().AsReadOnly();
		}
	}

	...
}

What does this proposal attempt to solve or improve?

A place for mods to look for, and contribute to, listings of entities (by their type field’s value) by a given name (e.g. any ‘spooky’ NPC, any explosive item, etc.).

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Chicken-Bonescommented, Jul 5, 2020

Basically ore dictionary from minecraft forge. Yes

0reactions
hamstar0commented, Jul 6, 2020

That works if all mods had a reference to the ItemFlammableTag class, but that might not always be the case with a crowd sourced list. If a system like that were added, the group definitions would have to exist in tModLoader.

No, you misunderstood the concept. That class is just a local shortcut, it does not define a tag, it’s like a ref to data of such tag.

Is TagData<TagShortcut>() meant to be a constructor call? This looks unfamiliar to me.

The parenthesis was a typo, replaced the link.

Alright, but if I’m understanding this correctly, entity group data is mapped to that (generic) class type. The generic parameter is the class that would need to be mod-agnostic, AKA stored in tModLoader or else expected as a mod dependency.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Performing entity group transactions (REST API)
The Table service supports entity group transactions on entities that are in the same table and belong to the same partition group.
Read more >
Azure Table Storage Query in .NET With Property Names ...
I have written a Azure table storage client which supports both static and late binding (via a dictionary). Any table property not contained...
Read more >
Deleting Entities In Windows Azure Table Storage
In Azure tables, entity uniqueness in a table is determined by the combination of PartitionKey (which physically groups related entities together for efficiency) ......
Read more >
Insert Entities into multiple Azure Table Storage partitions ...
I have an Azure Worker Role set up to get information from a few external web services, parse it into several different entity...
Read more >
Exploring Azure Table Storage with PowerShell
A document store encapsulates all the data for an entity (document) using a ... Table Storage - Azure Resource Group - Description: Create...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found