Exemplo n.º 1
0
    public void Add(Artifact artifact)
    {
        // if the artifact is a duplicate, we assume the set has already been assigned
        if (artifactsCollected.ContainsKey(artifact))
        {
            artifactsCollected[artifact]++;
        }
        else
        {
            if (setCollected.ContainsKey(artifact.set))
            {
                setCollected[artifact.set]++;
            }
            else
            {
                setCollected.Add(artifact.set, 1);
            }

            artifactsCollected.Add(artifact, 1);
        }

        // invoke a method for anything subscribed to the callback
        // if nothing is subscribed, then dont invoke
        if (onArtifactAddedCallback != null)
        {
            onArtifactAddedCallback.Invoke();
        }
        collectionUI.UpdateSetUI(artifact.set);
    }