示例#1
0
    void GetProcessingStateValue()
    {
        foreach (var State in ProcessingStateList)
        {
            State.Value.Add(0);
        }

        int CurrentIndex = ProcessingStateList[0].Value.Count - 1;

        ProcessingStateList[0].Value[CurrentIndex] += CallGoodsValue.GetStoredGoods().Count;

        int TotalWorkLoad = 0;

        foreach (var State in ProcessingStateList)
        {
            foreach (var FacilityInfo in CallFacilityValue.FacilityList)
            {
                if (FacilityInfo.ObjectActCall.Info.Type != "Processor")
                {
                    continue;
                }

                ProcessorAct TargetProcessorValue = FacilityInfo.Object.GetComponent <ProcessorAct>();
                if (TargetProcessorValue.TargetGoodsRecipe != null)
                {
                    if (TargetProcessorValue.TargetGoodsRecipe.OutputName == State.Title)
                    {
                        State.Value[CurrentIndex] += TargetProcessorValue.WorkLoadPerDay;
                        TotalWorkLoad             += TargetProcessorValue.WorkLoadPerDay;
                    }
                }
            }
        }

        ProcessingStateList[1].Value[CurrentIndex] += TotalWorkLoad;

        for (int i = 0; i < ProcessingStateList.Count; i++)
        {
            if (ProcessingStateList[i].Value.Count > xValueMaximum)
            {
                ProcessingStateList[i].Value.RemoveAt(0);
            }
        }
    }
 void GetTargetObject()
 {
     TargetObject             = CallPanelController.CurrentFloatingPanel.GetComponent <ObjectInfoPanelController>().TargetObject;
     CallInstallableObjectAct = TargetObject.GetComponent <InstallableObjectAct>();
     CallTargetProcessorAct   = TargetObject.GetComponent <ProcessorAct>();
 }
示例#3
0
    public void Initializing()
    {
        ElectricityStateList    = new List <float> [3];
        ElectricityStateList[0] = new List <float>();
        ElectricityStateList[1] = new List <float>();
        ElectricityStateList[2] = new List <float>();

        LaborForceStateList    = new List <float> [5];
        LaborForceStateList[0] = new List <float>();
        LaborForceStateList[1] = new List <float>();
        LaborForceStateList[2] = new List <float>();
        LaborForceStateList[3] = new List <float>();
        LaborForceStateList[4] = new List <float>();

        ProcessingStateList = new List <ProcessingState>();
        ProcessingState newState;

        newState = new ProcessingState("Warehouse", new Color(1f, 1f, 0.2f, 1f));
        ProcessingStateList.Add(newState);
        newState = new ProcessingState("Total", new Color(1f, 1f, 1f, 1f));
        ProcessingStateList.Add(newState);
        newState = new ProcessingState("Zero", new Color(0, 0, 0, 0));
        ProcessingStateList.Add(newState);
        foreach (var FacilityInfo in CallFacilityValue.FacilityList)
        {
            if (FacilityInfo.ObjectActCall.Info.Type == "Processor")
            {
                ProcessorAct TargetProcessorValue = FacilityInfo.Object.GetComponent <ProcessorAct>();
                if (TargetProcessorValue.TargetGoodsRecipe == null)
                {
                    continue;
                }

                bool isDuplicate = false;

                foreach (var State in ProcessingStateList)
                {
                    if (State.Title == TargetProcessorValue.TargetGoodsRecipe.OutputName)
                    {
                        isDuplicate = true;
                        break;
                    }
                }

                if (!isDuplicate)
                {
                    newState = new ProcessingState(TargetProcessorValue.TargetGoodsRecipe.OutputName, new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f), 1f));

                    ProcessingStateList.Add(newState);
                }
            }
        }

        GetElectricityStateValue();
        GetLaborForceStateValue();
        GetProcessingStateValue();

        CreateProcessingGraphIndex();

        DrawGraph();
    }