Ejemplo n.º 1
0
    /// <summary>
    /// Generates a Special Employee, by generating Skills Special, etc. for the Employee.
    /// </summary>
    /// <param name="empDef">The EmployeeDefinition this Employee is built upon.</param>
    /// <returns>Employee Data for the EmployeeDefinition</returns>
    public virtual EmployeeData GenerateSpecialEmployee(EmployeeDefinition empDef)
    {
        EmployeeData employee = new EmployeeData
        {
            EmployeeDefinition = empDef,
            Skills             = GenerateSkills(),
            hireableDays       = empDef.SpawnLikelihood == 1 ? -1 : rnd.Next(3, 7)
        };

        foreach (var special in empDef.EmployeeSpecials)
        {
            var matches = EmployeeSpecials.Where(s => s.Name == special).ToList();
            if (matches.Any())
            {
                var instance = (EmployeeSpecial)Activator.CreateInstance(matches.First());
                employee.AddSpecial(instance);
            }
        }

        addSpecials(employee);
        LevelUpSkills(employee.Skills);
        employee.Salary = calcSalary(employee);
        employee.Prize  = calcPrize(employee);
        return(employee);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Checks if all the Conditions for an EmployeeDefinition is Met.
    /// </summary>
    /// <param name="empDef">The EmployeeDefinition to check</param>
    /// <returns>True iff all Conditions for this EmployeeDefinition are met</returns>
    protected internal virtual bool ConditionsMet(EmployeeDefinition empDef)
    {
        if (!empDef.SpawnWhenAllConditionsAreMet)
        {
            return(true);
        }
        if (empDef.MissionSucceeded.Any(mission => !missionManager.GetData().Completed
                                        .Any(completedMission => completedMission.Definition = mission)))
        {
            return(false);
        }

        if (empDef.GameProgress > teamManager.calcGameProgress())
        {
            return(false);
        }
        return(!((gameTime.GetData().Date.GetDateTime() - new DateTime(1, 1, 1)).TotalDays <
                 empDef.NumberOfDaysTillEmpCanSpawn));
    }
Ejemplo n.º 3
0
 /// <summary>
 /// Sets the Employee, if this animation is specific to an employee.
 /// </summary>
 /// <param name="_emp">The Employee.</param>
 public void SetEmp(EmployeeDefinition _emp)
 {
     Debug.Log("Hello World!" + emp.EmployeeName);
     emp = _emp;
 }