/// <summary> /// This will see if the vector includes this type (and if the event is strong enough). If so, it will raise its own event /// </summary> private void Watcher_EventOccurred(object sender, LifeEventArgs e) { if (this.EventOccurred == null) { return; } // Find the location in the vector for this type for (int cntr = 0; cntr < _types.Length; cntr++) { if (_types[cntr].Item1 != e.Type) { continue; // wrong type } if (e.Strength < _types[cntr].Item2) { return; // not strong enough } // Create the vector double[] vector = new double[_types.Length]; double[] vector_scaled = new double[_types.Length]; vector[cntr] = 1; vector_scaled[cntr] = UtilityCore.GetScaledValue(0, 1, _types[cntr].Item2, 1, e.Strength); // Raise event this.EventOccurred(this, new LifeEventVectorArgs(e, vector, vector_scaled)); } }
public LifeEventVectorArgs(LifeEventArgs args, double[] vector, double[] vector_scaled) { this.Time = args.Time; this.Type = args.Type; this.Strength = args.Strength; this.Vector = vector; this.Vector_Scaled = vector_scaled; }