/// <summary> /// Adds a point given by its coordinates and id. /// </summary> /// <param name="x"> /// A <see cref="System.Double"/> /// </param> /// <param name="y"> /// A <see cref="System.Double"/> /// </param> /// <param name="id"> /// A <see cref="System.Int32"/> /// </param> public void Add (double x, double y, int id) { SongPoint point = new SongPoint (x, y, id); tree_list[0].Add (point); dict.Add (id,point); }
/// <summary> /// Allocates an actor for the given point. /// </summary> /// <param name="p"> /// A <see cref="SongPoint"/> /// </param> /// <returns> /// A <see cref="SongActor"/> /// </returns> public SongActor AllocateAtPosition (SongPoint p) { if (free_actors.Count < 1) return null; SongActor actor = free_actors.Pop (); switch (p.Selection) { case SongPoint.SelectionMode.Full: actor.SetPrototypeByColor (SongActor.Color.Red); break; case SongPoint.SelectionMode.Partial: actor.SetPrototypeByColor (SongActor.Color.LightRed); break; default: actor.SetPrototypeByColor (SongActor.Color.White); break; } actor.SetPosition ((float)p.X, (float)p.Y); actor.Opacity = 255; actor.Owner = p; actor.Show (); return actor; }