Beispiel #1
0
    public static Citizen CitizenFromAproximation(string name, ECONOMIC_CLASS economicClass,
                                                  Index.STATE healthState, Index.STATE happinessState, CityPart.PLACE livingPlace, City city)
    {
        int money;

        switch (economicClass)
        {
        case ECONOMIC_CLASS.LOW:
            money = Global.Methods.GetRandom(0, 1500);
            break;

        case ECONOMIC_CLASS.HIGH:
            money = Global.Methods.GetRandom(3500, 10000);
            break;

        case ECONOMIC_CLASS.MIDDLE:
        default:
            money = Global.Methods.GetRandom(1500, 3500);
            break;
        }
        float   healthValue    = Index.GetRoughValueFromState(healthState);
        float   happinessValue = Index.GetRoughValueFromState(happinessState);
        Citizen res            = new Citizen(name, money, healthValue, happinessValue, livingPlace, ENVIROMENTAL_COMMITMENT.NONE, city);

        return(res);
    }
Beispiel #2
0
    public static Citizen RandomCitizen(string name, City city)
    {
        ECONOMIC_CLASS economicClass = (ECONOMIC_CLASS)Global.Methods.GetRandom(Enum.GetNames(typeof(ECONOMIC_CLASS)).Length);

        Index.STATE    healthState   = (Index.STATE)Global.Methods.GetRandom(Enum.GetNames(typeof(Index.STATE)).Length);
        Index.STATE    happinesState = (Index.STATE)Global.Methods.GetRandom(Enum.GetNames(typeof(Index.STATE)).Length);
        CityPart.PLACE livingPlace   = (CityPart.PLACE)Global.Methods.GetRandom(Enum.GetNames(typeof(CityPart.PLACE)).Length);
        Citizen        res           = CitizenFromAproximation(name, economicClass, healthState, happinesState, livingPlace, city);

        return(res);
    }