コード例 #1
0
    public void AddTutorialContent(List <Scenario> scenarios)
    {
        //now get a random incident data from JSON file
        if (jsonReader == null)
        {
            jsonReader = this.GetComponent <SimplifiedJson>();
        }
        if (_incidentDifficultyManager == null)
        {
            _incidentDifficultyManager = this.GetComponent <IncidentDifficultyManager>();
        }

        foreach (var scenario in scenarios)
        {
            var newIncident = new Incident
            {
                IncidentContent = scenario.Content.Scene,
                Scenario        = scenario,
                TurnToShow      = 0,
            };

            newIncident.TurnToDevelop = 0 + newIncident.IncidentContent.TurnReq + 1;

            //our complete list of incidents
            incidents.Add(newIncident);

            //our list of incidents waiting to show this turn
            NextIncident.Add(newIncident);
            m_IncidentQueue.AddToQueue(newIncident);
        }
    }
コード例 #2
0
    public void AddNewIncidents(int turn)
    {
        if (incidents.Count >= MaxIncidents)
        {
            return;
        }

        if (_incidentDifficultyManager == null)
        {
            _incidentDifficultyManager = this.GetComponent <IncidentDifficultyManager>();
        }

        var totalOfficersAvailable   = OfficerController.TotalOfficers;
        var currentOfficersAvailable = OfficerController.GetAvailable();

        var newIncidents = _incidentDifficultyManager.GetNewIncidents(incidents, MaxIncidents, totalOfficersAvailable, turn + 1,
                                                                      currentOfficersAvailable, null);

        if (newIncidents != null)
        {
            foreach (var newIncident in newIncidents)
            {
                newIncident.TurnToShow    = turn;
                newIncident.TurnToDevelop = turn + newIncident.IncidentContent.TurnReq;
                //our complete list of incidents
                incidents.Add(newIncident);

                NextIncident.Add(newIncident);
                m_IncidentQueue.AddToQueue(newIncident);
            }
        }
    }
コード例 #3
0
    public void CreateNewIncident(int zTurn)
    {
        //now get a random incident data from JSON file
        if (jsonReader == null)
        {
            jsonReader = this.GetComponent <SimplifiedJson>();
        }
        if (_incidentDifficultyManager == null)
        {
            _incidentDifficultyManager = this.GetComponent <IncidentDifficultyManager>();
        }
        // create new incidents, randome amount between 1 and 3

        if (incidents.Count >= MaxIncidents)
        {
            return;
        }

        var location = Location.CurrentLocation;
        var language = DeviceLocation.shouldOverrideLanguage ? DeviceLocation.overrideLanguage.ToString() : "English";

        var newIncident = new Incident();

#if ALLOW_DUPLICATE_INCIDENTS
        jsonReader.CreateNewScenario(location, language);
#else
        jsonReader.CreateNewScenario(location, language, incidents);
#endif
        newIncident.TurnToShow    = zTurn;
        newIncident.TurnToDevelop = zTurn + newIncident.IncidentContent.TurnReq;
        //our complete list of incidents
        incidents.Add(newIncident);
        //our list of incidents waiting to show this turn
        NextIncident.Add(newIncident);
        m_IncidentQueue.AddToQueue(newIncident);
    }