public void Unassign(CardAssignment card) { using (this.actorEditor.StartUndo($"Remove card {card.GetCard().GetTitle()}")) { AssignedBehavior editor = card.GetAssignedBehavior(); editor.RemoveSelfFromActor(); } }
public void Unassign(CardAssignment card) { using (this.actorBehaviorsEditor.StartUndo($"Remove card {card.GetCard().GetTitle()}")) { AssignedBehavior cardUse = card.GetAssignedBehavior(); // Remove use ID from deck property. List <string> deckUseIds = new List <string>((string[])deckEditor.data); bool didExist = deckUseIds.Remove(cardUse.useId); if (!didExist) { Util.LogError($"Programmer error? The removed card did not actually exist in our deck.."); } deckEditor.SetData(deckUseIds.ToArray()); // Remove from actor brain cardUse.RemoveSelfFromActor(); } }