Example #1
0
    //启动一个Action
    public bool StartAction(Action config, EventPart ep, bool high, SkillContext context = null)
    {
        ZWAction zwaction = new ZWAction(config, this, ep, high, context);

        this.actionList_.AddTail(zwaction);
        return(true);
    }
Example #2
0
        public void FeedActionsDataGrid(DataGridView dt)
        {
            DataTable data = new DataTable();

            data.Columns.Add("Tramo");
            data.Columns.Add("Acción");
            data.Columns.Add("Tiempo");
            data.Columns.Add("Patente");
            data.Columns.Add("Tipo");

            foreach (SectionAction action in actions_list)
            {
                Model.Action _action = Model.Action.FindById(action.action_id);
                _action.description = (_action.description.Contains("Agregar")) ? "Agregar" : "Quitar";
                Locomotive locomotive = Locomotive.FindById(action.locomotive_id);
                if (locomotive == null)
                {
                    Wagon    wagon = Wagon.FindById(action.wagon_id);
                    Object[] row   = { this.properity, _action.description, _action.minutes, wagon.patent, "Carro" };
                    data.Rows.Add(row);
                }
                else
                {
                    Object[] row = { this.properity, _action.description, _action.minutes, locomotive.patent, "Locomotora" };
                    data.Rows.Add(row);
                }
            }
            dt.DataSource = data;
        }
Example #3
0
        public int AllTimeForAction()
        {
            int minute_counter = 0;

            foreach (SectionAction item in this.actions_list)
            {
                Model.Action action = Model.Action.Find(item.action_id);
                minute_counter += action.minutes;
            }
            return(minute_counter);
        }
Example #4
0
    private IEnumerator LoadActionObject(string path, Action <ModelAction> loadFinish)
    {
        TLEditorWww roleWww = TLEditorWww.Create(path);

        while (!roleWww.Finished)
        {
            yield return(null);
        }
        ModelAction actionConfig = roleWww.GetAsset() as Model.Action;

        if (actionConfig == null)
        {
            Debug.LogError("Error, Load role Failed: " + path);
        }
        else
        {
            Debug.Log(actionConfig.ActionEvents.Length);
        }
        roleWww.Unload();
        loadFinish(actionConfig);
    }
Example #5
0
        private string Create(string match, string mitemps, string temps, string equipe, string joueur, string action, string remarque)
        {
            string result = "";

            try {
                PartieDAO        ptdao = new PartieDAO(connexion);
                EquipeDAO        eqdao = new EquipeDAO(connexion);
                EquipeDetailsDAO eddao = new EquipeDetailsDAO(connexion);
                ActionDAO        acdao = new ActionDAO(connexion);
                PartieDetailsDAO pddao = new PartieDetailsDAO(connexion);

                Partie        pt     = ptdao.Select("WHERE id='" + match + "'").First();
                Equipe        eq     = eqdao.Select("WHERE nom='" + equipe + "'").First();
                EquipeDetails detail = eddao.Select("WHERE id='" + joueur + "'").First();
                Model.Action  act    = acdao.Select("WHERE id='" + action + "'").First();

                PartieDetails pd = new PartieDetails(pt, int.Parse(mitemps), Convert.ToDateTime(temps), eq, detail, act, remarque);

                result = pddao.Insert(pd.ToInsert());
            } catch (Exception ex) {
                throw ex;
                //System.Windows.Forms.MessageBox.Show(ex.StackTrace);
            } return(result);
        }