public ProgressSave()
    {
        Dictionary <string, int> d = new Dictionary <string, int>();

        foreach (string str in CampaignManager.campaigns.Keys)
        {
            d[str] = CampaignManager.campaigns[str].spot;
        }
        savedCampaigns = new DictContainer <string, int>(d);
        difficulty     = Difficulty.dLevel;
    }
Example #2
0
    public HouseSave(GameObject go) : base(go)
    {
        House h = go.GetComponent <House>();

        Residents  = h.Residents;
        HouseSize  = h.HouseSize;
        Prosperity = h.Prosperity;

        Water     = h.Water;
        WaterQual = h.WaterQual;

        Food = h.Food;

        Goods = h.Goods;

        VenueAccess = new DictContainer <string, int>(h.VenueAccess);
        Culture     = h.Culture;

        Faith = new DictContainer <string, int>(h.Faith);
    }
Example #3
0
    public HouseSave(GameObject go) : base(go)
    {
        House h = go.GetComponent <House>();

        Hygiene           = h.Hygiene;
        Savings           = h.Savings;
        Corpses           = h.Corpses;
        DiseasedResidents = h.DiseasedResidents;

        //thirst
        Thirst           = h.Thirst;
        WaterQualCurrent = h.WaterQualCurrent;

        //hunger
        Hunger          = h.Hunger;
        FoodQualCurrent = h.FoodQualCurrent;

        Goods = h.Goods;

        VenueAccess = new DictContainer <string, int>(h.VenueAccess);
        Culture     = h.Culture;

        Residents = h.Residents;
    }
Example #4
0
 //load the saved productivities from other
 public static void LoadProductivities(DictContainer <string, float> p, DictContainer <string, float> a)
 {
     productivities  = p.GetDictionary();
     automationValue = a.GetDictionary();
 }
Example #5
0
    public WorldProgressSave(GameObject go)
    {
        WorldController w = go.GetComponent <WorldController>();

        world = w.Map;

        productivities = new DictContainer <string, float>(ProductivityController.productivities);
        automation     = new DictContainer <string, float>(ProductivityController.automationValue);

        saveDate = DateTime.Now;
        Debug.Log(saveDate.ToString("MM/dd/yyyy"));

        Events = w.notifications.Events;

        //SAVE IN-GAME STUFF
        time           = new TimeSave(w.timeController);
        population     = new PopulationSave(w.population);
        money          = new MoneySave(w.money);
        camera         = new CameraSave(w.cameraController);
        immigration    = new ImmigrationSave(w.immigration);
        actionSelecter = new ActionSelecterControllerSave(w.actionSelecter);
        trade          = new TradeSave(w.trade);
        diplomacy      = new DiplomacySave(w.diplomacy);
        scenario       = new ScenarioSave(w.scenario);
        research       = new ResearchSave(w.research);

        //SAVE OBJECTS FROM PARENT
        //structures
        foreach (Transform t in w.structures.transform)
        {
            GameObject str = t.gameObject;

            if (str.GetComponent <StorageBuilding>() != null)
            {
                storagebuildings.Add(new StorageBuildingSave(str));
            }

            else if (str.GetComponent <Stable>() != null)
            {
                stables.Add(new StableSave(str));
            }

            else if (str.GetComponent <Crop>() != null)
            {
                crops.Add(new CropSave(str));
            }

            else if (str.GetComponent <Generator>() != null)
            {
                generators.Add(new GeneratorSave(str));
            }

            else if (str.GetComponent <WTP>() != null)
            {
                wtps.Add(new WTPSave(str));
            }

            else if (str.GetComponent <Canal>() != null)
            {
                canals.Add(new CanalSave(str));
            }

            else if (str.GetComponent <House>() != null)
            {
                houses.Add(new HouseSave(str.gameObject));
            }

            else if (str.GetComponent <Farmhouse>() != null)
            {
                farmhouses.Add(new FarmhouseSave(str));
            }

            else if (str.GetComponent <Workplace>() != null)
            {
                workplaces.Add(new WorkplaceSave(str));
            }

            else if (str.GetComponent <Jobcentre>() != null)
            {
                jobcentres.Add(new JobcentreSave(str));
            }

            else if (str.GetComponent <Structure>() != null)
            {
                structures.Add(new StructureSave(str));
            }

            else
            {
                Debug.Log(str.name + " shouldn't be under structures");
            }
        }

        //walkers
        foreach (Transform t in w.walkers.transform)
        {
            GameObject wlkr = t.gameObject;

            if (wlkr.GetComponent <Animal>() != null)
            {
                animals.Add(new AnimalSave(wlkr));
            }

            else if (wlkr.GetComponent <Walker>() != null)
            {
                walkers.Add(new WalkerSave(wlkr));
            }

            else
            {
                Debug.Log(wlkr.name + " shouldn't be under walkers");
            }
        }
    }
Example #6
0
 public TradeSave(TradeController tc)
 {
     tradeOrders       = new DictContainer <ItemOrder, bool>(tc.TradeOrders);
     caravansThisMonth = tc.caravansThisMonth;
     timeDelta         = tc.TimeDelta;
 }