Example #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")
                {
                }
            }
        }
    }
Example #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));
        }
    }
Example #3
0
 private void ExecuteNewCommand(Command command)
 {
     command.Execute();
     _commandsNav.AddToUndo(command);
     _commandsNav.ClearRedo();
 }
Example #4
0
 public void StoreAndExecute(Command cmd)
 {
     this.commandHistory.Add(cmd);
     cmd.Execute();
     Console.WriteLine("Command Executes");
 }
Example #5
0
 public int ExecuteCommand(Command command)
 {
     return(command.Execute());
 }
Example #6
0
 public void Click()
 {
     Console.WriteLine("Clicked copy button");
     _command.Execute();
 }
Example #7
0
 public void Record(string statement)
 {
     var command = new Command(_receiver, statement);
     command.Execute();
     StoreCommand(command);
 }
Example #8
0
 public void ButtonWasPressed()
 {
     command.Execute();
 }