Beispiel #1
0
    private List <Structure> FindAllWheelBarrAndDockBuilds()
    {
        List <Structure> all = BuildingController.FindAllStructOfThisType(H.Masonry);

        all.AddRange(BuildingController.FindAllStructOfThisType(H.Dock));
        return(all);
    }
Beispiel #2
0
    public void GoUp()
    {
        Debug.Log("Up");

        var dispatch = _dispatchManager.ReturnDispatchThatHostOrder(_order);

        if (dispatch == null)
        {
            return;
        }

        dispatch.IncreaseOrderPriority(_order);

        //order from all Heavy Loaders
        var heavys = BuildingController.FindAllStructOfThisType(H.HeavyLoad);

        for (int i = 0; i < heavys.Count; i++)
        {
            heavys[i].Dispatch1.IncreaseOrderPriority(_order);
        }

        //so it repositions
        oldAmt = -1000;
        _buildingWindow.ResetShownInventory();
    }
Beispiel #3
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="type"></param>
    /// <param name="factor"></param>
    /// <param name="ageMin">not included</param>
    /// <param name="ageMax">not incl</param>
    /// <returns></returns>
    static float CalculateCoverage(H type)
    {
        if (_build.Count == 0)
        {
            LoadBuildStats();
        }

        var factor = GiveMeStat(type).Factor;
        var ageMin = GiveMeStat(type).MinAge;
        var ageMax = GiveMeStat(type).MaxAge;

        var schools     = BuildingController.FindAllStructOfThisType(type);
        var acumPercent = 0f;

        for (int i = 0; i < schools.Count; i++)
        {
            acumPercent += schools[i].CurrentCoverage();
        }
        //the people can cover this tyoes of buildings shcools for ex. with 2 schools working at full will cover
        //40 people bz the factor is 2
        var peopleCanCover = acumPercent * factor;
        //amt of people that need the coverage
        var amtPplTtl = PersonPot.Control.All.Count(a => a.Age > ageMin && a.Age < ageMax);
        //final coverage if can cover 20 people and 30 needed then the cover is gonna be .66
        var fin = peopleCanCover / amtPplTtl;

        if (fin > 1)
        {
            return(1);
        }
        return(fin);
    }