Skip to content

Commit a12cd04

Browse files
WIP ability identifier
1 parent 00a8ea0 commit a12cd04

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

Models/CustomCard.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ public CustomCard(string name, List<AbilityIdentifier> abilityIds)
5454
{
5555
this.name = name;
5656
CustomCard.cards.Add(this);
57-
foreach (AbilityIdentifier id in abilityIds)
57+
if (abilityIds is not null)
5858
{
59-
if (id.id != 0)
59+
foreach (AbilityIdentifier id in abilityIds)
6060
{
61-
this.abilities.Add(id.id);
62-
abilityIds.Remove(id);
61+
if (id.id != 0)
62+
{
63+
this.abilities.Add(id.id);
64+
}
6365
}
6466
}
6567
if (abilityIds is not null)

Models/NewCard.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,14 @@ public static void Add(string name, List<CardMetaCategory> metaCategories, CardC
127127

128128
NewCard.cards.Add(card);
129129

130-
foreach (AbilityIdentifier id in abilityIds)
130+
if (abilityIds is not null)
131131
{
132-
if (id.id != 0)
132+
foreach (AbilityIdentifier id in abilityIds)
133133
{
134-
card.abilities.Add(id.id);
135-
abilityIds.Remove(id);
134+
if (id.id != 0)
135+
{
136+
card.abilities.Add(id.id);
137+
}
136138
}
137139
}
138140
if (abilityIds is not null)

Plugin.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ private void Start()
5858
if (id.id != 0)
5959
{
6060
NewCard.cards[item.Key].abilities.Add(id.id);
61-
item.Value.Remove(id);
6261
}
6362
else
6463
{
@@ -73,7 +72,6 @@ private void Start()
7372
if (id.id != 0)
7473
{
7574
CustomCard.cards[item.Key].abilities.Add(id.id);
76-
item.Value.Remove(id);
7775
}
7876
else
7977
{

0 commit comments

Comments
 (0)