public virtual Interactor.Base CreateInteractor(TrackPlayer tp, ChannelMessage cm) { EPointF ptLoc = new EPointF(); int note = cm.Data1; int strength = cm.Data2; int duration = 10; Interactor.Base interactor = null; LocSetter.Base locSetter = null; Endogine.Node node = this._trackSettings[tp.Track.Name]; if (node != null) { if (node["Interactor"] != null) { string sType = "MusicGame.Midi.Interactor." + node["Interactor"].Text; Type type = Type.GetType(sType); System.Reflection.ConstructorInfo cons = type.GetConstructor(new Type[] {}); interactor = (Interactor.Base)cons.Invoke(new object[] {}); } if (node["LocSetter"] != null) { string sType = "MusicGame.Midi.LocSetter." + node["LocSetter"].Text; Type type = Type.GetType(sType); System.Reflection.ConstructorInfo cons = type.GetConstructor(new Type[] {}); locSetter = (LocSetter.Base)cons.Invoke(new object[] {}); } } if (interactor == null) { interactor = new Interactor.Default(); } // if (locSetter==null) // locSetter = new LocSetter.Default(); interactor.Prepare(tp.Track.Name, cm.MidiChannel, this._readAheadMsecs, note, strength, duration, ptLoc); if (locSetter != null) { locSetter.Parent = interactor; } this._spritesToStart.Add(interactor); return(interactor); }
public virtual Interactor.Base CreateInteractor(TrackPlayer tp, ChannelMessage cm) { EPointF ptLoc = new EPointF(); int note = cm.Data1; int strength = cm.Data2; int duration = 10; Interactor.Base interactor = null; LocSetter.Base locSetter = null; Endogine.Node node = this._trackSettings[tp.Track.Name]; if (node != null) { if (node["Interactor"]!=null) { string sType = "MusicGame.Midi.Interactor."+node["Interactor"].Text; Type type = Type.GetType(sType); System.Reflection.ConstructorInfo cons = type.GetConstructor(new Type[]{}); interactor = (Interactor.Base)cons.Invoke(new object[]{}); } if (node["LocSetter"]!=null) { string sType = "MusicGame.Midi.LocSetter." + node["LocSetter"].Text; Type type = Type.GetType(sType); System.Reflection.ConstructorInfo cons = type.GetConstructor(new Type[]{}); locSetter = (LocSetter.Base)cons.Invoke(new object[]{}); } } if (interactor==null) interactor = new Interactor.Default(); // if (locSetter==null) // locSetter = new LocSetter.Default(); interactor.Prepare(tp.Track.Name, cm.MidiChannel, this._readAheadMsecs, note, strength, duration, ptLoc); if (locSetter!=null) locSetter.Parent = interactor; this._spritesToStart.Add(interactor); return interactor; }