예제 #1
0
        public T Find(string name)
        {
            BaseResource <T> fileToFind = new BaseResource <T>(ZombieGame.Content, name);
            int fileIndex = Resources.IndexOf(fileToFind);

            if (fileIndex == FILE_NOT_FOUND)
            {
                throw new RessourceNotFoundException();
            }

            return(Resources[fileIndex].ResourceData);
        }
예제 #2
0
        public void Add(string path)
        {
            BaseResource <T> fileToAdd = new BaseResource <T>(ZombieGame.Content, path);

            if (!Resources.Contains(fileToAdd))
            {
                fileToAdd.Load();

                lock (LockObj)
                {
                    Resources.Add(fileToAdd);
                }
            }
        }
예제 #3
0
 public bool Equals(BaseResource <T> other)
 {
     return(Name == other.Name);
 }