示例#1
0
        public bool load_next_resource()
        {
            try
            {
                if (loaded_groups_.Contains(cur_res_group_) == true)
                {
                    return(false);
                }

                Base_Res baseRes = cur_res_group_listor_.Current;

                if (baseRes == null)
                {
                    return(false);
                }

                if (baseRes is Imageset_Res)
                {
                    Imageset_Res imageRes = (Imageset_Res)baseRes;

                    if (Root.instance().imageset_manager().load_imageset(imageRes) == true)
                    {
                        imageset_map_.Add(imageRes.name_, imageRes);
                    }
                }
                else if (baseRes is Animation_Res)
                {
                    Animation_Res aniRes = (Animation_Res)baseRes;

                    if (Root.instance().animation_manager().load_animation(aniRes) == true)
                    {
                        animation_map_.Add(aniRes.name_, aniRes);
                    }
                }
                else if (baseRes is Sound_Res)
                {
                    Sound_Res soundRes = (Sound_Res)baseRes;

                    if (Root.instance().sound_manager().load_sound(soundRes.name_, soundRes.path_, true) == true)
                    {
                        sound_map_.Add(soundRes.name_, soundRes);
                    }
                }
                else if (baseRes is Music_Res)
                {
                    Music_Res musicRes = (Music_Res)baseRes;

                    if (Root.instance().music_manager().load_sound(musicRes.name_, musicRes.path_, false) == true)
                    {
                        music_map_.Add(musicRes.name_, musicRes);
                    }
                }

                cur_res_group_listor_.MoveNext();

                if (cur_res_group_listor_.Current == null)
                {
                    if (this.loaded_groups_.Contains(this.cur_res_group_) == false)
                    {
                        this.loaded_groups_.Add(this.cur_res_group_);
                    }
                }
            }
            catch
            {
                return(false);
            }

            return(true);
        }
示例#2
0
        //C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
        //	Resource_Manager();
        //C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
        //	public void Dispose();

        public void get_attribute(Base_Res baseRes, XElement element)
        {
            baseRes.name_ = (string)element.Attribute("Name");
            baseRes.path_ = AppDomain.CurrentDomain.BaseDirectory + (string)element.Attribute("Path");
        }