コード例 #1
0
    protected override object AdapterTipData(object data)
    {
        PackageProxy m_PackageProxy = GameFacade.Instance.RetrieveProxy(ProxyName.PackageProxy) as PackageProxy;

        if (data is LogDataVO)
        {
            return(m_PackageProxy.CreateItem(0, (data as LogDataVO).Tid, 0, 0, 0, 0, 0, 0));
        }
        if (data is ShopWindowVO)
        {
            return(m_PackageProxy.CreateItem(0, (data as ShopWindowVO).Tid, 0, 0, 0, 0, 0, 0));
        }
        if (data is ShopSellBackVO)
        {
            return(m_PackageProxy.CreateItem(0, (uint)(data as ShopSellBackVO).Tid, 0, 0, 0, 0, 0, 0));
        }
        if (data is ProduceInfoVO)
        {
            return(m_PackageProxy.CreateItem(0, (uint)(data as ProduceInfoVO).TID, 0, 0, 0, 0, 0, 0));
        }
        if (data is IShip)
        {
            return(m_PackageProxy.GetItem <ItemWarShipVO>((data as IShip).GetUID()));
        }
        if (data is IMod)
        {
            return(m_PackageProxy.GetItem <ItemModVO>((data as IMod).GetUID()));
        }
        if (data is IWeapon)
        {
            return(m_PackageProxy.GetItem <ItemWeaponVO>((data as IWeapon).GetUID()));
        }
        return(base.AdapterTipData(data));
    }
コード例 #2
0
    public void RefreshShipSkills()
    {
        skillVOs = null;

        List <PlayerShipSkillVO> skills = new List <PlayerShipSkillVO>();
        IShip currentShip = m_ShipProxy.GetAppointWarShip();

        if (currentShip != null)
        {
            ISkill[]      shipSkills = currentShip.GetSkillContainer().GetSkills();
            List <ISkill> tempList   = new List <ISkill>(shipSkills);
            tempList.Sort((skill1, skill2) =>
            {
                int pos1 = m_PackageProxy.GetItem <ItemSkillVO>(skill1.GetUID()).Position;
                int pos2 = m_PackageProxy.GetItem <ItemSkillVO>(skill2.GetUID()).Position;
                return(pos1.CompareTo(pos2));
            });

            foreach (var skill in tempList)
            {
                int skillID = (int)skill.GetTID();
                if (m_CfgEternityProxy.IsSkillExist(skillID))
                {
                    PlayerShipSkillVO skillVO = new PlayerShipSkillVO((int)skill.GetTID());
                    skills.Add(skillVO);
                }
            }
        }

        if (skills.Count > 0)
        {
            skillVOs = skills.ToArray();
        }

        SendNotification(NotificationName.MSG_SHIP_SKILL_CHANGED);
    }
コード例 #3
0
ファイル: ShipProxy.cs プロジェクト: mengtest/RewriteFrame
    /// <summary>
    /// 修改船数据包
    /// </summary>
    /// <param name="item"></param>
    /// <returns></returns>
    public void ChangeShipPackage(ulong id)
    {
        PackageProxy  m_PackageProxy = Facade.RetrieveProxy(ProxyName.PackageProxy) as PackageProxy;
        ItemWarShipVO itemWarShipVO  = m_PackageProxy.GetItem <ItemWarShipVO>(id);
        IShip         m_Ship         = null;

        m_Ship = WarShipDataFactory.BuildShipData(itemWarShipVO);
        m_ShipPackage.Add(m_Ship.GetUID(), m_Ship);
        IShip m_CurWarShip = GetAppointWarShip();

        if (!m_ShipPackage.ContainsKey(m_CurWarShip.GetUID()))
        {
            m_ShipPackage.Add(m_CurWarShip.GetUID(), m_CurWarShip);
        }
    }