示例#1
0
 private static WorldObject registerWorldObject(WorldObject h)
 {
     if (h == null) return null;
     lock (SpellLock) {
         string name = h.title.ToLower();
         if (_worldObjectNameMap.ContainsKey(name)) {
             h.image.Dispose();
             return _worldObjectNameMap[name];
         }
         _worldObjectNameMap.Add(name, h);
     }
     return h;
 }
示例#2
0
        private static WorldObject createWorldObject(SQLiteDataReader reader)
        {
            if (!reader.Read()) {
                return null;
            }

            WorldObject o = new WorldObject();
            o.title = reader.GetString(0);
            o.name = reader.GetString(1);
            o.image = Image.FromStream(reader.GetStream(2)); ;
            return o;
        }