예제 #1
0
 /// <summary>
 /// 添加生产中,生产完成或可生产 数据
 /// </summary>
 /// <param name="canProduce">是否可生产</param>
 protected void AddProduceingData(bool canProduce)
 {
     m_ListTempA = m_FoundryProxy.GetDataByMainType(m_CurrentBlueprintType);
     m_ListTempB = m_ListTempA.Concat(m_PartProduceList).ToList <Produce>();
     SetAllProduce(m_ListTempB);
     m_ListTemp = m_FoundryProxy.GetBluePrintDic().Values.ToList();
     m_ListTemp = SortCurrentData(m_ListTemp);
     if (!canProduce)
     {
         for (int i = 0; i < m_ListTemp.Count; i++)
         {
             if (m_ListTemp[i].BluePrintState == ProduceState.Producing || m_ListTemp[i].BluePrintState == ProduceState.Finsh)
             {
                 m_GridList.Add(m_ListTemp[i]);
             }
         }
         AddDataToView("production_title_1027", m_GridList);
     }
     else
     {
         for (int i = 0; i < m_ListTemp.Count; i++)
         {
             if (m_ListTemp[i].BluePrintState == ProduceState.CanProduce)
             {
                 m_GridList.Add(m_ListTemp[i]);
             }
         }
         AddDataToView("production_title_1028", m_GridList);
     }
 }
예제 #2
0
    /// <summary>
    /// 视图打开时调用
    /// </summary>
    /// <param name="owner">父视图</param>
    public override void OnShow(object msg)
    {
        base.OnShow(msg);
        m_FoundryProxy     = GameFacade.Instance.RetrieveProxy(ProxyName.FoundryProxy) as FoundryProxy;
        m_PackageProxy     = GameFacade.Instance.RetrieveProxy(ProxyName.PackageProxy) as PackageProxy;
        m_CfgEternityProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;
        m_ServerListProxy  = GameFacade.Instance.RetrieveProxy(ProxyName.ServerListProxy) as ServerListProxy;
        m_ShipProxy        = GameFacade.Instance.RetrieveProxy(ProxyName.ShipProxy) as ShipProxy;
        HOLD_TIME          = State.GetAction(UIAction.Product_Accelerate).StateList[0].Time;
        m_ExpendNumber     = m_CfgEternityProxy.GetGamingConfig(1).Value.Produce.Value.FinishExpenseRate;
        m_ProduceView      = OwnerView as ProduceView;
        m_FoundryProxy.GetAllDataByTable();
        m_PartProduceList = m_FoundryProxy.GetDataByMainType(BlueprintL1.Material);//零件
        NetworkManager.Instance.GetFoundryController().SendGetFoundryInfo();
        MsgOpenProduce msgOpenProduce = (MsgOpenProduce)msg;

        m_CurrentType = msgOpenProduce.CurrentProduceType;
        m_Grad        = (int)msgOpenProduce.MProduceDialogType;
        m_GradOld     = m_Grad;

        State.OnSelectionChanged -= OnSelectionDataChanged;
        State.OnSelectionChanged += OnSelectionDataChanged;
        State.GetAction(UIAction.Product_Accelerate).Callback        += OnProduce;
        State.GetAction(UIAction.Product_Cancel).Callback            += OnCanelProduce;
        State.GetAction(UIAction.Product_ProduceAndCollect).Callback += OnRevecie;
        State.GetAction(UIAction.Product_Accelerate).Visible          = false;
        switch (m_CurrentType)
        {
        case ProduceType.HeavyWeapon:
            m_CurrentBlueprintType = BlueprintL1.Weapon;
            break;

        case ProduceType.Reformer:
            m_CurrentBlueprintType = BlueprintL1.Reformer;
            break;

        case ProduceType.Chip:
            m_CurrentBlueprintType = BlueprintL1.EquipmentMod;
            break;

        case ProduceType.Device:
            m_CurrentBlueprintType = BlueprintL1.Equipment;
            break;

        case ProduceType.Ship:
            m_CurrentBlueprintType = BlueprintL1.Warship;
            m_FoundryProxy.InitShipPackage();
            break;

        default:
            break;
        }
    }