/// <summary>
        /// Serialize a lamp to a .json file for easier creation of like objects.
        /// </summary>
        private static void SerializeLamps()
        {
            LampTileComponent lampTop = new LampTileComponent(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Furniture.Lamps.OakLamp", TextureManager.GetTexture(ModCore.Manifest, "Furniture", "Oak Lamp"), typeof(LampTileComponent), Color.White), new BasicItemInformation("Oak Lamp", "Omegasis.Revitalize.Furniture.Lamps.OakLamp", "A basic wooden light.", "Lamps", Color.Brown, -300, 0, true, 100, true, true, TextureManager.GetTexture(ModCore.Manifest, "Furniture", "Oak Lamp"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Furniture", "Oak Lamp"), new Animation(new Rectangle(0, 0, 16, 16))), Color.White, true, new InventoryManager(), new LightManager()));

            LampTileComponent lampMiddle = new LampTileComponent(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Furniture.Lamps.OakLamp", TextureManager.GetTexture(ModCore.Manifest, "Furniture", "Oak Lamp"), typeof(LampTileComponent), Color.White), new BasicItemInformation("Oak Lamp", "Omegasis.Revitalize.Furniture.Lamps.OakLamp", "A basic wooden light.", "Lamps", Color.Brown, -300, 0, true, 100, true, true, TextureManager.GetTexture(ModCore.Manifest, "Furniture", "Oak Lamp"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Furniture", "Oak Lamp"), new Animation(new Rectangle(0, 16, 16, 16))), Color.White, true, new InventoryManager(), new LightManager()));
            LampTileComponent lampBottom = new LampTileComponent(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Furniture.Lamps.OakLamp", TextureManager.GetTexture(ModCore.Manifest, "Furniture", "Oak Lamp"), typeof(LampTileComponent), Color.White), new BasicItemInformation("Oak Lamp", "Omegasis.Revitalize.Furniture.Lamps.OakLamp", "A basic wooden light.", "Lamps", Color.Brown, -300, 0, true, 100, true, true, TextureManager.GetTexture(ModCore.Manifest, "Furniture", "Oak Lamp"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Furniture", "Oak Lamp"), new Animation(new Rectangle(0, 32, 16, 16))), Color.White, false, new InventoryManager(), new LightManager()));

            lampMiddle.lightManager.addLight(new Vector2(Game1.tileSize), new LightSource(4, new Vector2(0, 0), 2.5f, Color.Orange.Invert()), lampMiddle);

            LampMultiTiledObject lamp = new LampMultiTiledObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Furniture.Lamps.OakLamp", TextureManager.GetTexture(ModCore.Manifest, "Furniture", "Oak Lamp"), typeof(LampMultiTiledObject), Color.White), new BasicItemInformation("Oak Lamp", "Omegasis.Revitalize.Furniture.Lamps.OakLamp", "A basic wooden light", "Lamps", Color.Brown, -300, 0, true, 300, true, true, TextureManager.GetTexture(ModCore.Manifest, "Furniture", "Oak Lamp"), new AnimationManager(), Color.White, false, new InventoryManager(), new LightManager()));

            lamp.addComponent(new Vector2(0, -2), lampTop);
            lamp.addComponent(new Vector2(0, -1), lampMiddle);
            lamp.addComponent(new Vector2(0, 0), lampBottom);

            FactoryInfo lT = new FactoryInfo(lampTop);
            FactoryInfo lM = new FactoryInfo(lampMiddle);
            FactoryInfo lB = new FactoryInfo(lampBottom);

            FactoryInfo lO = new FactoryInfo(lamp);

            ModCore.Serializer.SerializeContentFile("OakLamp_0_-2", lT, Path.Combine(LampsFolder, "OakLamp"));
            ModCore.Serializer.SerializeContentFile("OakLamp_0_-1", lM, Path.Combine(LampsFolder, "OakLamp"));
            ModCore.Serializer.SerializeContentFile("OakLamp_0_0", lB, Path.Combine(LampsFolder, "OakLamp"));
            ModCore.Serializer.SerializeContentFile("OakLamp", lO, Path.Combine(LampsFolder, "OakLamp"));

            //ModCore.customObjects.Add(lamp.info.id, lamp);
        }
        /// <summary>
        /// Deserializes all lamp files for the mod.
        /// </summary>
        private static void DeserializeLamps()
        {
            if (!Directory.Exists(Path.Combine(ModCore.ModHelper.DirectoryPath, "Content", LampsFolder)))
            {
                Directory.CreateDirectory(Path.Combine(ModCore.ModHelper.DirectoryPath, "Content", LampsFolder));
            }
            string[] directories = Directory.GetDirectories(Path.Combine(ModCore.ModHelper.DirectoryPath, "Content", LampsFolder));

            foreach (string directory in directories)
            {
                string[] files = Directory.GetFiles(directory);

                Dictionary <string, LampMultiTiledObject> objs = new Dictionary <string, LampMultiTiledObject>();

                //Deserialize container.
                foreach (string file in files)
                {
                    if ((Path.GetFileName(file)).Contains("_") == true)
                    {
                        continue;
                    }
                    else
                    {
                        FactoryInfo factoryInfo = ModCore.Serializer.DeserializeContentFile <FactoryInfo>(file);
                        objs.Add(Path.GetFileNameWithoutExtension(file), new LampMultiTiledObject(factoryInfo.PyTkData, factoryInfo.info));
                    }
                }
                //Deseralize components
                foreach (string file in files)
                {
                    if ((Path.GetFileName(file)).Contains("_") == false)
                    {
                        continue;
                    }
                    else
                    {
                        string[]    splits = Path.GetFileNameWithoutExtension(file).Split('_');
                        string      name   = splits[0];
                        Vector2     offset = new Vector2(Convert.ToInt32(splits[1]), Convert.ToInt32(splits[2]));
                        FactoryInfo info   = ModCore.Serializer.DeserializeContentFile <FactoryInfo>(file);

                        LampTileComponent lampPiece = new LampTileComponent(info.PyTkData, info.info);
                        //Recreate the lights info.
                        if (lampPiece.lightManager != null)
                        {
                            //ModCore.log("Info for file"+Path.GetFileNameWithoutExtension(file)+" has this many lights: " + info.info.lightManager.fakeLights.Count);
                            lampPiece.lightManager.lights.Clear();
                            foreach (KeyValuePair <Vector2, FakeLightSource> light in info.info.lightManager.fakeLights)
                            {
                                lampPiece.lightManager.addLight(new Vector2(Game1.tileSize), new LightSource(light.Value.id, new Vector2(0, 0), light.Value.radius, light.Value.color.Invert()), lampPiece);
                            }
                        }


                        objs[name].addComponent(offset, lampPiece);
                    }
                }
                foreach (var v in objs)
                {
                    ModCore.ObjectManager.lamps.Add(v.Value.info.id, v.Value);
                }
            }
        }