private void OnObjectiveStateChanged(object sender, ObjectiveStateChangedEventArgs args) { Text text; if (!this.objectiveTexts.TryGetValue(args.Objective, out text)) { return; } switch (args.State) { case ObjectiveState.Inactive: text.color = Color.white; break; case ObjectiveState.Active: text.color = Color.yellow; break; case ObjectiveState.Complete: text.color = Color.green; break; } }
private void OnObjectiveStateChanged(object sender, ObjectiveStateChangedEventArgs args) { this.mayLeave = args.CompletedObjectives == args.TotalObjectives; if (this.mayLeave) { // Victory! this.EventManager.OnVictory(this, EventArgs.Empty); } }
public void OnObjectiveStateChanged(object sender, ObjectiveStateChangedEventArgs args) { var handler = this.ObjectiveStateChanged; if (handler != null) { handler(sender, args); } }
private void OnObjectiveStateChanged(object sender, ObjectiveStateChangedEventArgs args) { this.completedObjectives = args.CompletedObjectives; this.totalObjectives = args.TotalObjectives; }