Beispiel #1
0
        /// ////////////////////////////////////////////////////////
        private void AssureVariableCible()
        {
            if (ProcessParent != null)
            {
                ProcessParent.AssureVariableCible();
                return;
            }
            //SC le 27/4/07, si le type cible est null, il faut supprimer la variable de type cible

            /*if( m_typeCible == null )
             *      return;*/
            if (m_variableCible != null && (m_variableCible.TypeDonnee.TypeDotNetNatif != m_typeCible ||
                                            m_variableCible.TypeDonnee.IsArrayOfTypeNatif != m_bSurTableauDeCible))
            {
                m_listeVariables.Remove(m_variableCible);
                m_variableCible = null;
            }
            if (m_typeCible != null && m_variableCible == null)
            {
                m_variableCible = new CVariableProcessTypeComplexe(this);
                //TESTDBKEYOK
                m_variableCible.IdVariable = c_strIdVariableElement;
                m_variableCible.Nom        = c_nomVariableElement;
                m_variableCible.SetTypeDonnee(new CTypeResultatExpression(m_typeCible, m_bSurTableauDeCible));
                m_listeVariables.Add(m_variableCible);
            }
        }
    public void ChangeScene(ProcessType type)
    {
        mCurrentProcess.SceneEnd();

        switch (type)
        {
        case ProcessType.Battle:
            mCurrentProcess = mProcessBattle;
            break;

        case ProcessType.CardDetail:
            mCurrentProcess = mProcessCardDetail;
            break;

        case ProcessType.CardSelect:
            mCurrentProcess = mProcessCardSelect;
            break;

        case ProcessType.Loading:
            mCurrentProcess = mProcessLoading;
            break;

        case ProcessType.Dump:
            mCurrentProcess = mProcessDump;
            break;
        }

        mCurrentProcess.SceneStart();
    }
    // Use this for initialization
    void Start()
    {
        mProcessBattle     = GetComponentInChildren <ProcessBattle>();
        mProcessCardDetail = GetComponentInChildren <ProcessCardDetail>();
        mProcessCardSelect = GetComponentInChildren <ProcessCardSelect>();
        mProcessLoading    = GetComponentInChildren <ProcessLoading>();
        mProcessDump       = GetComponentInChildren <ProcessDump>();

        mCurrentProcess = mProcessLoading;
        //mCurrentProcess = mProcessLoading;

        mCurrentProcess.SceneStart();
    }
Beispiel #4
0
        /// /////////////////////////////////////////////
        public object GetValeurChamp(string strIdVariable)
        {
            foreach (CVariableDynamique variable in m_listeVariables)
            {
                if (variable.IdVariable == strIdVariable)
                {
                    return(GetValeurChamp(variable));
                }
            }

            if (ProcessParent != null)
            {
                return(ProcessParent.GetValeurChamp(strIdVariable));
            }

            return(null);
        }
Beispiel #5
0
        /// /////////////////////////////////////////////
        public object GetValeurChamp(IVariableDynamique variable)
        {
            if (variable == null)
            {
                return(null);
            }

            object valRetour = null;

            if (variable is CVariableDynamiqueCalculee)
            {
                CVariableDynamiqueCalculee variableCalculee = (CVariableDynamiqueCalculee)variable;
                return(variableCalculee.GetValeur(this));
            }
            else
            {
                object val = m_tableValeursChamps[variable.IdVariable];
                if (val == null && variable is CVariableDynamiqueSaisie)
                {
                    if (ProcessParent != null)
                    {
                        return(ProcessParent.GetValeurChamp(variable));
                    }
                    else
                    {
                        m_tableValeursChamps[variable.IdVariable] = ((CVariableDynamiqueSaisie)variable).GetValeurParDefaut();
                    }
                }
                if (val == null && variable is CVariableProcessTypeComplexe)
                {
                    if (ProcessParent != null)
                    {
                        return(ProcessParent.GetValeurChamp(variable));
                    }
                    else
                    {
                        m_tableValeursChamps[variable.IdVariable] = ((CVariableProcessTypeComplexe)variable).GetValeurParDefaut(ContexteDonnee);
                    }
                }

                return(m_tableValeursChamps[variable.IdVariable]);
            }
        }
Beispiel #6
0
        /// ////////////////////////////////////////////////////////
        public CResultAErreur SetValeurChamp(string strIdVariable, object valeur)
        {
            bool bVariableIsMine = ProcessParent == null;;

            if (!bVariableIsMine)
            {
                foreach (CVariableDynamique variable in m_listeVariables)
                {
                    if (variable.IdVariable == strIdVariable)
                    {
                        bVariableIsMine = true;
                        break;
                    }
                }
                if (!bVariableIsMine && ProcessParent != null)
                {
                    return(ProcessParent.SetValeurChamp(strIdVariable, valeur));
                }
            }
            object valeurCorrigee = valeur;

            if (valeur != null && strIdVariable == c_strIdVariableElement &&
                m_bSurTableauDeCible && !(valeur.GetType().IsArray) &&
                !typeof(IList).IsAssignableFrom(valeur.GetType()))
            {
                ArrayList lst = new ArrayList();
                lst.Add(valeur);
                valeurCorrigee = lst.ToArray();
            }
            CObjetDonnee objDonnee = valeurCorrigee as CObjetDonnee;

            if (objDonnee != null && ContexteDonnee != null)
            {
                valeurCorrigee = objDonnee.GetObjetInContexte(ContexteDonnee);
            }
            m_tableValeursChamps[strIdVariable] = valeurCorrigee;


            return(CResultAErreur.True);
        }