Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracker.Trace(...) methods are prone to failure (sould be Obsolete) #26

Open
RotaruDan opened this issue Jan 25, 2017 · 1 comment
Open

Comments

@RotaruDan
Copy link
Contributor

Problem

The methods

public void Trace (params string[] values)

and

public void Trace (string trace)

Available at Tracker.cs are prone to failure because they require to be invoked with exactly 3 arguments in a specific order, as we can see below.

For the method:

public void Trace (params string[] values)
  1. Verb: String, e.g. "initialized"
  2. TargetId: String, e.g. "my_quest_mission"
  3. TargetType. String, e.g. "completable"

For the method:

public void Trace (string trace)
  1. CSV: String, e.g. "initialized", "completable", "my_quest_mission"

Any other invocation would result in failure.

@RotaruDan
Copy link
Contributor Author

RotaruDan commented Jan 25, 2017

Solution

  1. We will create a new method with a well defined signature
    /// <summary>
    /// Adds a trace with the specified values
    /// Type = GameObject 
    /// </summary>
    /// <param name="verb">Verb: String, e.g. "initialized"</param>
    /// <param name="targetType">Verb: String, e.g. "completable"</param>
    /// <param name="TargetId">Verb: String, e.g. "my_quest_mission"</param>
    public void Trace (string verb, string targetType, string targetId)
  1. Mark as obsolete the previous methods:
[Obsolete("Trace (params string[] values) and Trace (string trace) are deprecated, please use Trace (string verb, string targetType, string targetId) instead.", true)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant