Пример #1
0
    public static Employee GenerateEmployee()
    {
        var title        = JobTitle.GetRandomTitle();
        var new_employee = new Employee();

        new_employee.CurrentTitle = title;
        new_employee.Salary       = Mathf.CeilToInt(title.SkillRequirements.Sum() * salary_skill_factor)
                                    * Random.Range(50, 60) * 1000;
        new_employee.HireCost        = Mathf.CeilToInt(Random.Range(0.05f, 1.0f) * new_employee.Salary);
        new_employee.Name            = PersonNames.GetRandomName();
        new_employee.Age             = Random.Range(18, 50);
        new_employee.CurrentLocation = Location.GetRandomLocation();
        new_employee.Skills          = new SkillList();
        for (int i = 0; i < SkillInfo.COUNT; i++)
        {
            new_employee.Skills[(Skill)i] = title.SkillRequirements[(Skill)i] + Random.Range(2, 5);
        }
        new_employee.Morale = 50.0f;

        return(new_employee);
    }
Пример #2
0
    public static Job[] GenerateJobs(int count)
    {
        var jobs = new List <Job>();

        int char_name_val = Character.MyCharacter.Name.Aggregate(0, (current, c) => current + c);

        Random.InitState(TimeManager.Month * TimeManager.Year * (char_name_val + 1));

        for (int i = 0; i < count; i++)
        {
            var new_job = new Job();
            new_job.CompanyName  = CompanyNames.GetRandomName();
            new_job.Salary       = Random.Range(50, 60) * 1000;
            new_job.CurrentTitle = JobTitle.GetRandomTitle();
            new_job.JobLocation  = Location.GetRandomLocation();
            new_job.Salary       = Mathf.CeilToInt(new_job.Salary * new_job.CurrentTitle.PayFactor);
            new_job.SigningBonus = Mathf.CeilToInt(Random.Range(0.05f, 1.0f) * new_job.Salary);

            jobs.Add(new_job);
        }

        return(jobs.ToArray());
    }