Ejemplo n.º 1
0
    void doCast(Graph spell)
    {
        foreach (Node n in spell.Traverse())
        {
            CommandPattern.Command c = (n as CommandPattern.Command);
            if (c != null)
            {
                Dictionary <string, object> args = new Dictionary <string, object>();
                args.Add("primitive", PrimitiveType.Sphere);
                args.Add("position", transform.position);
                args.Add("direction", transform.forward * 2);
                args.Add("object", "orb");


                c.Execute(null, args);
                if (c.nname == "EXPLODE")
                {
                }
            }
        }
    }
Ejemplo n.º 2
0
    IEnumerator DoCast(GameObject go, Graph spell)
    {
        foreach (Node n in spell.Traverse())
        {
            CommandPattern.Command c = (n as CommandPattern.Command);
            if (c == null)
            {
                continue;
            }

            Dictionary <string, object> args = new Dictionary <string, object>();
            args.Add("primitive", PrimitiveType.Sphere);
            args.Add("position", transform.position);
            args.Add("direction", transform.forward * 2);
            args.Add("object", "orb");

            //if (c.name == "EXPLODE")
            //{

//            }
            c.Execute(go, args);
            yield return(new WaitForSeconds(.1f));
        }
    }
Ejemplo n.º 3
0
 private void ExecuteNewCommand(Command command)
 {
     command.Execute();
     _commandsNav.AddToUndo(command);
     _commandsNav.ClearRedo();
 }
Ejemplo n.º 4
0
 public void StoreAndExecute(Command cmd)
 {
     this.commandHistory.Add(cmd);
     cmd.Execute();
     Console.WriteLine("Command Executes");
 }
Ejemplo n.º 5
0
 public int ExecuteCommand(Command command)
 {
     return(command.Execute());
 }
Ejemplo n.º 6
0
 public void Click()
 {
     Console.WriteLine("Clicked copy button");
     _command.Execute();
 }
Ejemplo n.º 7
0
 public void Record(string statement)
 {
     var command = new Command(_receiver, statement);
     command.Execute();
     StoreCommand(command);
 }
Ejemplo n.º 8
0
 public void ButtonWasPressed()
 {
     command.Execute();
 }