Skip to content

Commit dee3954

Browse files
committed
add unique
1 parent 49c873d commit dee3954

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

CathodeLib/Scripts/CATHODE/CommandsPAK/Helpers/ShortGuidUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private static void Cache(ShortGuid guid, string value, bool isVanilla = false)
135135
}
136136
else
137137
{
138-
//TODO: need to fix this for BSPNOSTROMO_RIPLEY_PATCH
138+
//TODO: need to fix this for BSPNOSTROMO_RIPLEY_PATCH (?)
139139
if (_custom.cache.ContainsKey(value)) return;
140140
_custom.cache.Add(value, guid);
141141
try

CathodeLib/Scripts/CATHODE/Resources.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@ override protected bool SaveInternal()
6363
}
6464
#endregion
6565

66+
public void AddUniqueResource(ShortGuid composite_instance_id, ShortGuid resource_id)
67+
{
68+
if (Entries.FirstOrDefault(o => o.composite_instance_id == composite_instance_id && o.resource_id == resource_id) != null)
69+
return;
70+
71+
Entries.Add(new Resource()
72+
{
73+
composite_instance_id = composite_instance_id,
74+
resource_id = resource_id
75+
});
76+
}
77+
6678
#region STRUCTURES
6779
public class Resource
6880
{

0 commit comments

Comments
 (0)