Пример #1
0
        /// <summary>
        /// This creates a list of all states, also those inherited from the base class.
        /// </summary>
        public Dictionary <string, StateStructure> GetAllStates()
        {
            // [ZZ] we should NOT pick up any states from Actor. (except Spawn, as the very default state)
            //      for the greater good. (otherwise POL5 from GenericCrush is displayed for actors without frames, preferred before TNT1)
            if (classname.ToLowerInvariant() == "actor")
            {
                Dictionary <string, StateStructure> list2 = new Dictionary <string, StateStructure>(StringComparer.OrdinalIgnoreCase);
                if (states.ContainsKey("spawn"))
                {
                    list2.Add("spawn", states["spawn"]);
                }
                return(list2);
            }

            Dictionary <string, StateStructure> list = new Dictionary <string, StateStructure>(states, StringComparer.OrdinalIgnoreCase);

            if (!skipsuper && (baseclass != null))
            {
                Dictionary <string, StateStructure> baselist = baseclass.GetAllStates();
                foreach (KeyValuePair <string, StateStructure> s in baselist)
                {
                    if (!list.ContainsKey(s.Key))
                    {
                        list.Add(s.Key, s.Value);
                    }
                }
            }

            return(list);
        }
Пример #2
0
        /// <summary>
        /// This creates a list of all states, also those inherited from the base class.
        /// </summary>
        public Dictionary <string, StateStructure> GetAllStates()
        {
            Dictionary <string, StateStructure> list = new Dictionary <string, StateStructure>(states, StringComparer.OrdinalIgnoreCase);

            if (!skipsuper && (baseclass != null))
            {
                Dictionary <string, StateStructure> baselist = baseclass.GetAllStates();
                foreach (KeyValuePair <string, StateStructure> s in baselist)
                {
                    if (!list.ContainsKey(s.Key))
                    {
                        list.Add(s.Key, s.Value);
                    }
                }
            }

            return(list);
        }