Ejemplo n.º 1
0
        public GameGlobal Get(string filename)
        {
            lock (Cache)
            {
                if (Cache.ContainsKey(filename))
                {
                    return(Cache[filename]);
                }

                //if we can't load this let it throw an exception...
                //probably sanity check this when we add user objects.
                var iff = new Iff(Path.Combine(Content.Get().BasePath, "objectdata\\globals\\" + filename + ".iff"));
                OTF otf = null;
                try
                {
                    otf = new OTF(Path.Combine(Content.Get().BasePath, "objectdata\\globals\\" + filename + ".otf"));
                }
                catch (IOException)
                {
                    //if we can't load an otf, it probably doesn't exist.
                }
                var resource = new GameGlobalResource(iff, otf);

                var item = new GameGlobal
                {
                    Resource = resource
                };

                Cache.Add(filename, item);

                return(item);
            }
        }
Ejemplo n.º 2
0
 public GameGlobalResource(Iff iff, OTF tuning)
 {
     this.Iff    = iff;
     this.Tuning = tuning;
 }
Ejemplo n.º 3
0
 public GameObjectResource(Iff iff, Iff sprites, OTF tuning)
 {
     this.Iff     = iff;
     this.Sprites = sprites;
     this.Tuning  = tuning;
 }