1using System.Collections.Generic;
19 [CreateAssetMenu(menuName =
"Mania Map/Collectable Group")]
23 private string _name =
"<None>";
27 public string Name {
get => _name;
set => _name = value; }
30 private List<CollectableGroupEntry> _collectables =
new List<CollectableGroupEntry>();
34 public List<CollectableGroupEntry>
Collectables {
get => _collectables;
set => _collectables = value; }
41 var result =
new List<int>();
45 for (
int i = 0; i < entry.Quantity; i++)
47 result.Add(entry.Collectable.Id);
78 if (entry.Collectable == collectable)
A class for creating groups of CollectableResource.
bool ContainsCollectable(CollectableResource collectable)
Returns true if the group contains the collectable.
List< int > GetCollectableIds()
Returns a list of collectable ID's in the quantity specified by the entries.
string Name
The group name.
List< CollectableGroupEntry > Collectables
A list of collectables.
bool AddCollectable(CollectableResource collectable)
Adds the collectable to the group if it is valid and doesn't already exist. Returns true if it is add...
An object representing a collectable with a unique ID.
A structure containing a collectable and a quantity.