Ejemplo n.º 1
0
        public void AddActor(Actor ActorToAdd)
        {
            ActorToAdd.SetCellX(CellNumberX);
            ActorToAdd.SetCellY(CellNumberY);

            GridActors.Add(ActorToAdd);
            ShowActor();
        }
Ejemplo n.º 2
0
 public void RemoveActor(Actor ActorToRemove)
 {
     this.Controls.Remove(ActorToRemove);
     GridActors.Remove(ActorToRemove);
 }
Ejemplo n.º 3
0
        public void GridCell_Click(object sender, EventArgs e)
        {
            if(((VisualProgramming)this.ParentForm).LastClick == "Actor")
            {
                Actor NewActor = new Actor();
                NewActor.SetColor(((VisualProgramming)(this.ParentForm)).ActorColorSelection);
                NewActor.SetDirection(((VisualProgramming)(this.ParentForm)).ActorDirectionSelection);
                NewActor.SetCellX(CellNumberX);
                NewActor.SetCellY(CellNumberY);
                NewActor.SetSize(this.Width - this.Width/4, this.Height - this.Height/4);

                GridActors.Add(NewActor);
                ((VisualProgramming)this.ParentForm).Actors.Add(NewActor);

                ShowActor();
            }
            else if (((VisualProgramming)this.ParentForm).LastClick == "Condition")
            {
                if(((VisualProgramming)this.ParentForm).Conditional != null)
                {
                    AddCondition(((VisualProgramming)this.ParentForm).Conditional);
                }
            }
            else if (((VisualProgramming)this.ParentForm).LastClick == "Response")
            {
                if (((VisualProgramming)this.ParentForm).Response != null)
                {
                    AddResponse(((VisualProgramming)this.ParentForm).Response);
                }
            }
            else if (((VisualProgramming)this.ParentForm).LastClick == "Remove")
            {
                if ((GridActors.Count - 1) > -1)
                {
                    RemoveActor(GridActors[GridActors.Count - 1]);
                }
            }

            ((VisualProgramming)this.ParentForm).Cursor = System.Windows.Forms.Cursors.Default;
        }