Пример #1
0
        // ***********************************************************************
        public bool LoadAE_EffectH(string p)
        {
            bool ret = false;

            if (File.Exists(p) == false)
            {
                return(ret);
            }

            string[] lines = LoadFile(p);
            if (lines.Length <= 0)
            {
                return(ret);
            }

            string[] ofs1 = FindTypeDef(lines, "typedef A_long PF_OutFlags");
            string[] ofs2 = FindTypeDef(lines, "typedef A_long PF_OutFlags2");
            string[] cmt  = SplitDescription(lines);

            m_out_flags.Clear();
            if (ofs1.Length > 0)
            {
                for (int i = 0; i < ofs1.Length; i++)
                {
                    AE_OutFlag of = new AE_OutFlag();
                    of.FromLine(ofs1[i]);
                    if (of.Name != "")
                    {
                        of.Description = FindDescription(cmt, of.Name);

                        m_out_flags.Add(of);
                    }
                }
            }
            m_out_flags2.Clear();
            if (ofs2.Length > 0)
            {
                for (int i = 0; i < ofs2.Length; i++)
                {
                    AE_OutFlag of = new AE_OutFlag();
                    of.FromLine(ofs2[i]);
                    if (of.Name != "")
                    {
                        of.Description = FindDescription(cmt, of.Name);

                        m_out_flags2.Add(of);
                    }
                }
            }
            ret = ((m_out_flags.Count > 0) && (m_out_flags2.Count > 0));
            if (ret)
            {
                m_AE_EffectH = p;
                CreateList();
            }

            return(ret);
        }
Пример #2
0
        public void FromObj(dynamic obj)
        {
            Clear();
            if (((DynamicJson)obj).IsArray)
            {
                dynamic[] a = (dynamic[])obj;

                if (a.Length > 0)
                {
                    m_flags = new AE_OutFlag[a.Length];
                    for (int i = 0; i < a.Length; i++)
                    {
                        AE_OutFlag of = new AE_OutFlag();
                        of.FromObj(a[i]);
                        m_flags[i] = of;
                    }
                }
            }
        }
Пример #3
0
 public void Add(AE_OutFlag itm)
 {
     Array.Resize(ref m_flags, m_flags.Length + 1);
     m_flags[m_flags.Length - 1] = itm;
 }