public TranslatedProbe(Point Offset, Probe Source) : base(Source) { this._Offset = Offset; }
public InputContext(Probe Probe) { this._Probe = Probe; }
public DerivedProbe(Probe Source) { this._Source = Source; }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); this.MakeCurrent(); this._Renderer = new Renderer(); this._Renderer.Cache = new FileSystemRenderCache(Program.Cache["Render"]); this._Renderer.Initialize(); SystemTypeface.Create = this._Renderer.CreateSystemTypeface; this._Probe = new Probe(); this._InputContext = new InputContext(this._Probe); this._Camera = new Camera(new Point(0.0, 0.0), 1.0); this._Ambience = new OceanAmbience(Random.Default); this._World = new World(this._InputContext, new Theme()); this._MakeView(); Content testcontent = new EditorContent(); this._World.Spawn(testcontent, Point.Origin); }
public _NodeProbe(Node Node, Probe Source) : base(Source) { this._Node = Node; }
/// <summary> /// Calls the probe signal change handler on the input context and returns wether the event was handled. /// </summary> /// <param name="Probe">The probe in the parent input context whose signal was changed.</param> public bool ProbeSignalChange(Probe Probe, ProbeSignal Signal, bool Value) { bool handled = false; if (this._ProbeSignalChange != null) { this._ProbeSignalChange(new _NodeProbe(this._Node, Probe), Signal, Value, ref handled); } return handled; }
/// <summary> /// Handles a probe signal change over the node. /// </summary> /// <param name="Offset">The offset of the probe from the top-left corner of the node.</param> public void ProbeSignalChange(World World, Probe Probe, Point Offset, ProbeSignal Signal, bool Value) { // See if the event can be handled by the content of the node if (this._InputContext.ProbeSignalChange(Probe, Signal, Value)) return; // Start dragging if possible if (this._DragState == null && Signal == ProbeSignal.Primary && Value == true) { this._DragState = new DragState { Offset = Offset, Probe = Probe, ReleaseProbe = Probe.Lock() }; } }
/// <summary> /// Handles a probe signal change event from the input context. /// </summary> private void _ProbeSignalChange(Probe Probe, ProbeSignal Signal, bool Value, ref bool Handled) { Point pos = Probe.Position; Node node = this.NodeAtPoint(pos); if (node != null) { Handled = true; node.ProbeSignalChange(this, Probe, pos - node.Position, Signal, Value); } }