Пример #1
0
        /// <summary>
        /// 可创建活动多人副本列表
        /// </summary>
        /// <returns></returns>
        public MorePlot[] GetMorePlotFestivalList(FunctionEnum functionEnum)
        {
            TList <MorePlot> morePlotsList = new TList <MorePlot>();
            var morePlotArray = new List <PlotInfo>();

            if (functionEnum == FunctionEnum.MorePlotCoin)
            {
                morePlotArray = new ConfigCacheSet <PlotInfo>().FindAll(m => m.PlotType == PlotType.MorePlotCoin);
            }
            else if (functionEnum == FunctionEnum.MorePlotEnergy)
            {
                morePlotArray = new ConfigCacheSet <PlotInfo>().FindAll(m => m.PlotType == PlotType.MorePlotEnergy);
            }
            if (morePlotArray.Count > 0)
            {
                //var morePlot = morePlotArray[0];
                foreach (PlotInfo info in morePlotArray)
                {
                    if (functionEnum == FunctionEnum.MorePlotCoin && IsMoreCombat(info.PlotID))
                    {
                        morePlotsList.Add(GetItem(info.PlotID));
                    }
                    else if (functionEnum == FunctionEnum.MorePlotEnergy && IsMoreCombat(info.PlotID))
                    {
                        morePlotsList.Add(GetItem(info.PlotID));
                    }
                }
            }
            return(morePlotsList.ToArray());
        }
Пример #2
0
        /// <summary>
        /// 获取攻击单位
        /// </summary>
        /// <param name="position">攻击方的位置</param>
        /// <param name="attackType">攻击方式</param>
        /// <param name="attackTaget">攻击目标</param>
        /// <param name="targetEmbattle"></param>
        private static CombatGeneral[] GetTargetUnit(int position, AttackUnit attackType, AttackTaget attackTaget, EmbattleQueue targetEmbattle)
        {
            IGeneral[]            generalList       = new IGeneral[0];
            TList <CombatGeneral> targetGeneralList = new TList <CombatGeneral>();

            switch (attackType)
            {
            case AttackUnit.Single:
                CombatGeneral cg = null;
                if (attackTaget == AttackTaget.Self)
                {
                    cg = (CombatGeneral)targetEmbattle.GetGeneral(position);
                }
                else
                {
                    cg = (CombatGeneral)targetEmbattle.FindGeneral(position);
                }
                if (cg != null)
                {
                    generalList = new IGeneral[] { cg };
                }
                break;

            case AttackUnit.Horizontal:
                generalList = targetEmbattle.FindHorizontal(position);
                break;

            case AttackUnit.Vertical:
                generalList = targetEmbattle.FindVertical(position);
                break;

            case AttackUnit.All:
                generalList = targetEmbattle.FindAll();
                break;

            default:
                break;
            }
            foreach (IGeneral general in generalList)
            {
                targetGeneralList.Add((CombatGeneral)general);
            }
            return(targetGeneralList.ToArray());
        }
Пример #3
0
 private void ReadWriteList\\(ref TList data)
     where TList : List\\, new()
     where TItem : IBitcoinSerializable, new()
 {
     var dataArray = data == null ? null : data.ToArray();
     if (Serializing && dataArray == null)
     {
         dataArray = new TItem[0];
     }
     ReadWriteArray(ref dataArray);
     if (!Serializing)
     {
         if (data == null)
             data = new TList();
         else
             data.Clear();
         data.AddRange(dataArray);
     }
 }
Пример #4
0
        public GameActive[] GetActiveList(FunctionEnum activeType)
        {
            TList <GameActive> activeList = new TList <GameActive>();

            foreach (var gameActive in _gameActiveList)
            {
                if (gameActive.ActiveType != FunctionEnum.Gonghui && (gameActive.ActiveType != activeType ||
                                                                      new GameDataCacheSet <UserFunction>().FindKey(_userId, gameActive.ActiveType) == null))
                {
                    continue;
                }
                activeList.Add(gameActive);
                if (activeType == FunctionEnum.Gonghui)
                {
                    if (gameActive.ActiveType == FunctionEnum.Gonghui)
                    {
                        GameUser userInfo = new GameDataCacheSet <GameUser>().FindKey(_userId);
                        if (userInfo != null)
                        {
                            UserGuild guild = new ShareCacheStruct <UserGuild>().FindKey(userInfo.MercenariesID);
                            if (guild != null)
                            {
                                GuildLvInfo lvInfo = new ConfigCacheSet <GuildLvInfo>().FindKey(guild.GuildLv);
                                if (lvInfo != null)
                                {
                                    var activityArray = lvInfo.ActivityDesc;
                                    foreach (ActivityShow activityShow in activityArray)
                                    {
                                        if (activityShow.ActivityID == (int)gameActive.ActiveStyle)
                                        {
                                            activeList.Add(gameActive);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            ;
            return(activeList.ToArray());
        }
Пример #5
0
        /// <summary>
        /// 可创建多人副本列表
        /// </summary>
        /// <returns></returns>
        public MorePlot[] GetMorePlotList()
        {
            TList <MorePlot> morePlotsList = new TList <MorePlot>();
            var plotsArray = UserPlotHelper.UserPlotFindAll(_userId);

            // todo new GameDataCacheSet<UserPlot>().FindAll(_userId);)
            foreach (UserPlotInfo plot in plotsArray)
            {
                var morePlotArray = new ConfigCacheSet <PlotInfo>().FindAll(u => u.PlotType == PlotType.MorePlot && u.PrePlotID == plot.PlotID);

                if (morePlotArray.Count > 0)
                {
                    var morePlot = morePlotArray[0];
                    if (IsCombat(morePlot.PlotID))
                    {
                        morePlotsList.Add(GetItem(morePlot.PlotID));
                    }
                }
            }
            return(morePlotsList.ToArray());
        }
Пример #6
0
 /// <summary>
 /// 获取攻击单位
 /// </summary>
 /// <param name="position">攻击方的位置</param>
 /// <param name="attackType">攻击方式</param>
 /// <param name="attackTaget">攻击目标</param>
 /// <param name="targetEmbattle"></param>
 private static CombatGeneral[] GetTargetUnit(int position, AttackUnit attackType, AttackTaget attackTaget, EmbattleQueue targetEmbattle)
 {
     IGeneral[] generalList = new IGeneral[0];
     TList<CombatGeneral> targetGeneralList = new TList<CombatGeneral>();
     switch (attackType)
     {
         case AttackUnit.Single:
             CombatGeneral cg = null;
             if (attackTaget == AttackTaget.Self)
             {
                 cg = (CombatGeneral)targetEmbattle.GetGeneral(position);
             }
             else
             {
                 cg = (CombatGeneral)targetEmbattle.FindGeneral(position);
             }
             if (cg != null)
             {
                 generalList = new IGeneral[] { cg };
             }
             break;
         case AttackUnit.Horizontal:
             generalList = targetEmbattle.FindHorizontal(position);
             break;
         case AttackUnit.Vertical:
             generalList = targetEmbattle.FindVertical(position);
             break;
         case AttackUnit.All:
             generalList = targetEmbattle.FindAll();
             break;
         default:
             break;
     }
     foreach (IGeneral general in generalList)
     {
         targetGeneralList.Add((CombatGeneral)general);
     }
     return targetGeneralList.ToArray();
 }
Пример #7
0
    //#region 更新图片的信息
    //protected void UpdateSpriteInfor()
    //{
    //    if (_OldVerts == null)
    //        return;

    //    CalcQuadTag(_OldVerts);
    //}
    //#endregion

    /// <summary>
    /// 绘制图片
    /// </summary>
    void DrawSprite()
    {
        if (m_spriteAsset == null)
        {
            return;
        }
        if (listSprite == null)
        {
            return;
        }
        if (m_spriteMesh == null)
        {
            m_spriteMesh = new Mesh();
        }
        else
        {
            m_spriteMesh.Clear();
        }

        TList <Vector3> tempVertices  = new TList <Vector3>();
        TList <Vector2> tempUv        = new TList <Vector2>();
        TList <int>     tempTriangles = new TList <int>();

        for (int i = 0; i < listSprite.Count; i++)
        {
            for (int j = 0; j < listSprite[i].vertices.Length; j++)
            {
                tempVertices.Add(listSprite[i].vertices[j]);
            }
            for (int j = 0; j < listSprite[i].uv.Length; j++)
            {
                tempUv.Add(listSprite[i].uv[j]);
            }
            for (int j = 0; j < listSprite[i].triangles.Length; j++)
            {
                tempTriangles.Add(listSprite[i].triangles[j]);
            }
        }
        //计算顶点绘制顺序
        for (int i = 0; i < tempTriangles.Count; i++)
        {
            if (i % 6 == 0)
            {
                int num = i / 6;
                tempTriangles[i]     = 0 + 4 * num;
                tempTriangles[i + 1] = 1 + 4 * num;
                tempTriangles[i + 2] = 2 + 4 * num;

                tempTriangles[i + 3] = 1 + 4 * num;
                tempTriangles[i + 4] = 0 + 4 * num;
                tempTriangles[i + 5] = 3 + 4 * num;
            }
        }

        m_spriteMesh.vertices  = tempVertices.ToArray();
        m_spriteMesh.uv        = tempUv.ToArray();
        m_spriteMesh.triangles = tempTriangles.ToArray();

        m_spriteCanvasRenderer.SetMesh(m_spriteMesh);
        m_spriteGraphic.UpdateMaterial();
    }
Пример #8
0
        /// <summary>
        /// 可创建多人副本列表
        /// </summary>
        /// <returns></returns>
        public MorePlot[] GetMorePlotList()
        {
            TList<MorePlot> morePlotsList = new TList<MorePlot>();
            var plotsArray = UserPlotHelper.UserPlotFindAll(_userId);
                // todo new GameDataCacheSet<UserPlot>().FindAll(_userId);)
            foreach (UserPlotInfo plot in plotsArray)
            {
                var morePlotArray = new ConfigCacheSet<PlotInfo>().FindAll(u => u.PlotType == PlotType.MorePlot && u.PrePlotID == plot.PlotID);

                if (morePlotArray.Count > 0)
                {
                    var morePlot = morePlotArray[0];
                    if (IsCombat(morePlot.PlotID))
                    {
                        morePlotsList.Add(GetItem(morePlot.PlotID));
                    }
                }
            }
            return morePlotsList.ToArray();
        }
Пример #9
0
 /// <summary>
 /// 可创建活动多人副本列表
 /// </summary>
 /// <returns></returns>
 public MorePlot[] GetMorePlotFestivalList(FunctionEnum functionEnum)
 {
     TList<MorePlot> morePlotsList = new TList<MorePlot>();
     var morePlotArray = new List<PlotInfo>();
     if (functionEnum == FunctionEnum.MorePlotCoin)
     {
         morePlotArray = new ConfigCacheSet<PlotInfo>().FindAll(m => m.PlotType == PlotType.MorePlotCoin);
     }
     else if (functionEnum == FunctionEnum.MorePlotEnergy)
     {
         morePlotArray = new ConfigCacheSet<PlotInfo>().FindAll(m => m.PlotType == PlotType.MorePlotEnergy);
     }
     if (morePlotArray.Count > 0)
     {
         //var morePlot = morePlotArray[0];
         foreach (PlotInfo info in morePlotArray)
         {
             if (functionEnum == FunctionEnum.MorePlotCoin && IsMoreCombat(info.PlotID))
             {
                 morePlotsList.Add(GetItem(info.PlotID));
             }
             else if (functionEnum == FunctionEnum.MorePlotEnergy && IsMoreCombat(info.PlotID))
             {
                 morePlotsList.Add(GetItem(info.PlotID));
             }
         }
     }
     return morePlotsList.ToArray();
 }
Пример #10
0
 public GameActive[] GetActiveList(FunctionEnum activeType)
 {
     TList<GameActive> activeList = new TList<GameActive>();
     foreach (var gameActive in _gameActiveList)
     {
         if (gameActive.ActiveType != FunctionEnum.Gonghui && (gameActive.ActiveType != activeType ||
             new GameDataCacheSet<UserFunction>().FindKey(_userId, gameActive.ActiveType) == null)) continue;
         activeList.Add(gameActive);
         if (activeType == FunctionEnum.Gonghui)
         {
             if (gameActive.ActiveType == FunctionEnum.Gonghui)
             {
                 GameUser userInfo = new GameDataCacheSet<GameUser>().FindKey(_userId);
                 if (userInfo != null)
                 {
                     UserGuild guild = new ShareCacheStruct<UserGuild>().FindKey(userInfo.MercenariesID);
                     if (guild != null)
                     {
                         GuildLvInfo lvInfo = new ConfigCacheSet<GuildLvInfo>().FindKey(guild.GuildLv);
                         if (lvInfo != null)
                         {
                             var activityArray = lvInfo.ActivityDesc;
                             foreach (ActivityShow activityShow in activityArray)
                             {
                                 if (activityShow.ActivityID == (int)gameActive.ActiveStyle)
                                 {
                                     activeList.Add(gameActive);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     };
     return activeList.ToArray();
 }
Пример #11
0
        /// <summary>
        /// ����Ƿ��������dz�
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public static bool IsNickName(string name)
        {
            //return new GameDataCacheSet<GameUser>().IsExist(u => u.NickName.ToLower() == name.ToLower().Trim());
            bool bl = false;
            bl = new GameDataCacheSet<GameUser>().IsExist(u => u.NickName.ToLower() == name.ToLower().Trim());
            if (!bl)
            {
                TList<SqlParameter> paramValues = new TList<SqlParameter>();
                string sql = "SELECT NickName FROM GameUser WHERE NickName = @NickName";
                paramValues.Add(SqlParamHelper.MakeInParam("@NickName", SqlDbType.VarChar, 0, name));
                using (SqlDataReader reader = SqlHelper.ExecuteReader(DbConfig.DataConnectString, CommandType.Text, sql, paramValues.ToArray()))
                {
                    while (reader.Read())
                    {
                        bl = true;
                    }
                }
            }

            return bl;
        }