Example #1
0
    public DemoJobObj AddDemolitionJob(JobDef newJobDef, int iLoc, int jLoc)
    {
        DemoJobObj newJobObj = new DemoJobObj(newJobDef, iLoc, jLoc);

        newJobObj.UpdateBonuses(jobBonusList);
        jobList.Add(newJobObj);
        return(newJobObj);
    }
Example #2
0
    void StartDemolitionJobButton()
    {
        //Debug.Log("StartDemolitionJobButton");
        short  surfaceValue = ManagerBase.domain.mapData.GetSurfaceValue(iLoc, jLoc);
        string surfaceType  = ManagerBase.surfaceValueDictionary.FirstOrDefault(x => x.Value == surfaceValue).Key;

        JobDef newDemolitionJobDef = CreateDemolitionJobDef(surfaceType);

        ResourceQuantityQualityList jobResources = new ResourceQuantityQualityList();

        //Debug.Log("AddDemolitionJob");
        DemoJobObj newJob = jobManager.AddDemolitionJob(newDemolitionJobDef, iLoc, jLoc);

        //Debug.Log("SetResources");
        newJob.SetResources(jobResources);
        newJob.StartJob();
        newJob.AddWorker();
        newJob.AddWorker();
        newJob.AddWorker();
        newJob.AddWorker();
        newJob.AddWorker();
        newJob.AddWorker();
        newJob.AddWorker();
        newJob.AddWorker();
        newJob.AddWorker();
        newJob.AddWorker();

        // Change surface type to construction
        //Debug.Log("SetSurfaceValue");
        ManagerBase.domain.mapData.SetSurfaceValue(iLoc, jLoc, ManagerBase.surfaceValueDictionary["Cancel"]);

        // Reload the map and re-focus on the tile
        //Debug.Log("Broadcast");
        WorldEventHandlerManager.Broadcast(worldEventChannels.map, mapChannelEvents.change, new WorldEventArg(iLoc, jLoc));

        //Debug.Log("Done StartDemolitionJobButton");
    }