Exemplo n.º 1
0
        /// <summary>
        /// Brand new Editor with the specified teamName and unitName.
        /// </summary>
        /// <param name="teamName">Team name.</param>
        /// <param name="unitName">Unit name.</param>
        public void Set(string teamName, string unitName)
        {
            this.RemoveAllChilds();
            cancel_stack = new Stack <List <Instruction> >();

            XMLInterpreter     interpreter  = new XMLInterpreter();
            List <Instruction> instructions = interpreter.xmlToUnitBehavior(teamName, Constants.teamsDirectory, unitName);

            this.Set(instructions);
        }
Exemplo n.º 2
0
        /********************************************
        ****** METHODES SPECIFIQUES AU WIDGET ******
        ********************************************/


        /// <summary>
        /// Initializes a new instance of the <see cref="WarBotEngine.Editeur.BehaviorEditor"/> class.
        /// </summary>
        /// <param name="teamName">Team name.</param>
        /// <param name="unitName">Unit name.</param>
        public BehaviorEditor(string teamName, string unitName) : base(new Rect(Screen.width * TeamSelection.DIM_WIDTH, 0, Screen.width * (1 - TeamSelection.DIM_WIDTH), Screen.height))
        {
            BehaviorEditor.actual = this;

            if (teamName != "")
            {
                XMLInterpreter     interpreter  = new XMLInterpreter();
                List <Instruction> instructions = interpreter.xmlToUnitBehavior(teamName, Constants.teamsDirectory, unitName);
                this.Set(instructions);
                cancel_stack = new Stack <List <Instruction> >();
                cancel_stack.Push(instructions);
            }
        }