Example #1
0
    /// <summary>
    /// Prepare the Diagnosis Tool
    /// </summary>
    /// <param name="gamemode">True = Gameplay, False = Practice</param>
    /// <param name="ui">The UI Exam Computer</param>
    public void Initialize(bool gamemode, UI_ExamRoomComputer ui = null )
    {
        if(gamemode){
            //make sure the help panel is off.
            panelHelp.SetActive(false);
            if (ui) { ercUI = ui; practice = false; }
        }
        else
        {
            //create an instance of ABG, or gain a reference of ABG
            abg = new ABG();
            //set practice to true
            practice = true;
            //turn on the help panel.
            panelHelp.SetActive(true);
        }

        //Set the original parents of the drag and drop objects
        if (tttPH && tttHCO3 && tttCO2)
        {
            startParentPH = tttPH.parent;
            startParentCO2 = tttCO2.parent;
            startParentHCO3 = tttHCO3.parent;
        }

        //get the original text for the answer fields.
        if (ansRM && ansAA && ansC)
        {
            defaultRM = ansRM.text;
            defaultAA = ansAA.text;
            defaultC = ansC.text;
        }
        //get the original color for the answer fields.
        if (imageAA && imageC && imageRM)
        {
            colNormal = imageRM.color;
        }
    }
Example #2
0
    /// <summary>
    /// Set up the manager
    /// </summary>
    private void ManagerInitialize()
    {
        //Initialize the ABG class and prepare all the diagnoses
        abg = new ABG("NursingInterventions");
        listWaitingChairs = new List<WaitingChair>();
        listExamRooms = new List<ExamRoom>();
        //listPatients = new List<Patient>();

        //Populate the list of waiting chairs.
        GameObject[] wc = GameObject.FindGameObjectsWithTag("WaitingChair");
        foreach (GameObject w in wc)
        {
            listWaitingChairs.Add(w.GetComponent<WaitingChair>());
        }

        //Populate the list of exam rooms.
        GameObject[] er = GameObject.FindGameObjectsWithTag("ExamRoom");
        foreach (GameObject e in er)
        {
            listExamRooms.Add(e.GetComponent<ExamRoom>());
        }

        //Find the triage
        triage = GameObject.FindGameObjectWithTag("Triage").GetComponent<Triage>();

        //Find the nurse
        nurse = GameObject.FindGameObjectWithTag("Nurse").GetComponent<Nurse>();

        //Find the Sink
        sink = GameObject.FindGameObjectWithTag("Sink").GetComponent<Sink>();

        //prepare the patients.
        for (int i = 0; i < prefabPatients.Length; i++)
        {
            GameObject temp = prefabPatients[i];
            int rand = Random.Range(0, prefabPatients.Length);
            prefabPatients[i] = prefabPatients[rand];
            prefabPatients[rand] = temp;
        }

        //Reset the score
        scorePatientsSeen = 0;
        scoreAngryPatients = 0;
        scoreCorrectDiagnoses = 0;
        scoreCorrectInitialAssessment = 0;
        scoreSatisfaction = 100f;

        currentPatients = 0;
        //reset the spawn timer
        timerSpawnUsed = 0.1f;

        //set the manager
        _manager = this;

        gameplayUI.satisfaction.SatisfactionUpdate(scoreSatisfaction);
        UpdatePatientsTreated();
    }