コード例 #1
0
    public void DetermineJobAction()
    {
        Job job = null;

        if (staff.HasJob())
        {
            job = staff.job;
        }
        switch (staff.parentStaff.jobType)
        {
        case Dispensary.JobType.None:
            ChangeStatus(StaffAction.waiting);
            return;

        case Dispensary.JobType.Cashier:
            if (staff.HasJob())
            {
                // Job
                job.OnEnterStore();

                // Cashier specific
                Cashier cashier = (Cashier)staff.job;
            }
            break;

        case Dispensary.JobType.StoreBudtender:
            if (staff.HasJob())
            {
                // Job
                job.OnEnterStore();

                // Store Budtender specific
                StoreBudtender cashier = (StoreBudtender)staff.job;
            }
            break;

        case Dispensary.JobType.SmokeBudtender:
            if (staff.HasJob())
            {
                // Job
                job.OnEnterStore();

                // Smoke Lounge Budtender specific
                SmokeBudtender smokeBudtender = (SmokeBudtender)staff.job;
            }
            break;
        }
        if (!staff.HasJob() && staff.parentStaff.jobType != Dispensary.JobType.None)
        {
            staff.CreateJob();
            DetermineJobAction();
        }
    }
コード例 #2
0
    // ------------------------------------------------------

    /*public void AssignJobDropdown()
     * {
     *  List<Action<Job>> actions = new List<Action<Job>>();
     *  List<string> actionNames = new List<string>();
     *  List<Job> parameters = new List<Job>();
     *  foreach (Job job in dm.dispensary.availableJobs)
     *  {
     *      actions.Add(AssignJob);
     *      actionNames.Add(job.jobName);
     *      parameters.Add(job);
     *  }
     *  ddm.SetupDropdown(actions, actionNames, parameters);
     * }*/

    public void SetAction(StaffPathfinding.StaffAction action)
    {
        if (pathfinding == null)
        {
            Start();
        }
        pathfinding.ChangeStatus(action);
        if (action == StaffPathfinding.StaffAction.leavingStore && HasJob())
        {
            switch (parentStaff.jobType)
            {
            case Dispensary.JobType.Cashier:
                Cashier cashier = (Cashier)job;
                cashier.register.assigned = null;
                Staff possibleStaff_needsRegister = dm.dispensary.StaffNeedsRegister();
                if (possibleStaff_needsRegister != null)
                {
                    if (possibleStaff_needsRegister.HasJob())
                    {
                        possibleStaff_needsRegister.job.OnEnterStore();
                        possibleStaff_needsRegister.parentStaff.ErrorFixed();
                    }
                }
                break;

            case Dispensary.JobType.StoreBudtender:
                StoreBudtender budtender = (StoreBudtender)job;
                budtender.station.assigned = null;
                Staff possibleStaff_needsBudtenderStation = dm.dispensary.StaffNeedsBudtenderStation();
                if (possibleStaff_needsBudtenderStation != null)
                {
                    if (possibleStaff_needsBudtenderStation.HasJob())
                    {
                        possibleStaff_needsBudtenderStation.job.OnEnterStore();
                        possibleStaff_needsBudtenderStation.parentStaff.ErrorFixed();
                    }
                }
                break;
            }
        }
    }