Esempio n. 1
0
    private void resetAvailableEngineersForHire()
    {
        deleteHireableEngineers();

        for (var i = 0; i < totalAvailableEngineersForHire; i++)
        {
            // Create a random engineer
            var proficiencyRand  = Random.Range(10, 100);
            var productivityRand = Random.Range(0.5f, 2.0f); // productivity of 1 means this engineer delivers 1 man month in 1 month

            var proficiency  = (int)proficiencyRand;         // 10-100 proficiency
            var productivity = productivityRand;

            var salary     = (proficiency * productivity);
            var salaryRand = (int)Random.Range(salary * -0.5f, salary * 0.5f);
            salary = salary + salaryRand; // based on proficiency and productivity +- half itself to add some randomness

            var eng = new EngineerStaff(proficiency, productivity, (int)salary);
            availableEngineersForHire.Add(eng);

            // Create hire engineer row
            var hireEngineerRow = Instantiate(HireEngineerRowPanel);
            hireEngineerRow.transform.SetParent(EngineerHiresAvailablePanel.transform, false);
            hireEngineerRow.GetComponentInChildren <HireEngineerButton>().Setup(eng);
            hireEngineerRows.Add(hireEngineerRow);
        }
    }
Esempio n. 2
0
    public void OnHireEngineer(EngineerStaff engineer)
    {
        hiredEngineers.Add(engineer);
        availableEngineersForHire.Remove(engineer);

        updateHiresText();
        CurrentMissionFullText.text = getCurrentMissionFullString();
        ExpencesText.text           = "Expenses: " + getMonthlySalaryExpenses();
        // Update engineering proficiency modifier
        //var engineeringQuality = getEngineeringMaxProficiency();
        //EngineeringProficiencyText.text = "Eng prof: " + engineeringProficiencyModifier;

        updateMissionContractButtonTexts();
    }
 public void Setup(EngineerStaff engineer)
 {
     engineerStaff = engineer;
     UpdateButtonText();
 }