当前位置: 首页>>代码示例>>C#>>正文


C# DataStruct.PushShortIntoStack方法代码示例

本文整理汇总了C#中ZyGames.Framework.Game.Service.DataStruct.PushShortIntoStack方法的典型用法代码示例。如果您正苦于以下问题:C# DataStruct.PushShortIntoStack方法的具体用法?C# DataStruct.PushShortIntoStack怎么用?C# DataStruct.PushShortIntoStack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ZyGames.Framework.Game.Service.DataStruct的用法示例。


在下文中一共展示了DataStruct.PushShortIntoStack方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildPacket

        public override void BuildPacket()
        {
            this.PushIntoStack(userPlotCombat.IsWin.ToShort());
            this.PushIntoStack(userPlotCombat.Experience);
            this.PushIntoStack(prizeItems.Count);
            foreach (PrizeItemInfo prizeItem in prizeItems)
            {
                ItemBaseInfo item = new ShareCacheStruct<ItemBaseInfo>().FindKey(prizeItem.ItemID);
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(item.ItemName.ToNotNullString());
                dsItem.PushIntoStack(item.HeadID.ToNotNullString());
                dsItem.PushIntoStack(item.QualityType.ToShort());
                dsItem.PushIntoStack(prizeItem.Num);

                PushIntoStack(dsItem);
            }
            //攻方阵形
            PushIntoStack(combatProcessList.AttackList.Count);
            foreach (CombatEmbattle combatEmbattle in combatProcessList.AttackList)
            {
                int isAttWait = combatEmbattle.IsWait ? 1 : 0;
                var general = _cacheSetGeneral.FindKey(combatEmbattle.GeneralID);
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(combatEmbattle.GeneralID);
                dsItem.PushIntoStack(combatEmbattle.GeneralName.ToNotNullString());
                //dsItem.PushIntoStack(combatEmbattle.HeadID.ToNotNullString());
                dsItem.PushIntoStack(general == null ? string.Empty : general.BattleHeadID.ToNotNullString());
                dsItem.PushIntoStack(combatEmbattle.Position.ToShort());
                dsItem.PushIntoStack(combatEmbattle.LiveNum);
                dsItem.PushIntoStack(combatEmbattle.LiveMaxNum);
                dsItem.PushIntoStack(combatEmbattle.MomentumNum);
                dsItem.PushIntoStack(combatEmbattle.MaxMomentumNum);
                dsItem.PushIntoStack(combatEmbattle.AbilityID);
                dsItem.PushIntoStack(combatEmbattle.GeneralLv);
                dsItem.PushIntoStack((short)isAttWait);
                // 增加佣兵品质
                dsItem.PushShortIntoStack(general == null ? 0 : general.GeneralQuality.ToShort());


                PushIntoStack(dsItem);
            }
            //防方阵形
            PushIntoStack(combatProcessList.DefenseList.Count);
            foreach (CombatEmbattle combatEmbattle in combatProcessList.DefenseList)
            {
                int isDefWait = combatEmbattle.IsWait ? 1 : 0;
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(combatEmbattle.GeneralID);
                dsItem.PushIntoStack(combatEmbattle.GeneralName.ToNotNullString());
                dsItem.PushIntoStack(combatEmbattle.HeadID.ToNotNullString());
                dsItem.PushIntoStack(combatEmbattle.Position.ToShort());
                dsItem.PushIntoStack(combatEmbattle.LiveNum);
                dsItem.PushIntoStack(combatEmbattle.LiveMaxNum);
                dsItem.PushIntoStack(combatEmbattle.MomentumNum);
                dsItem.PushIntoStack(combatEmbattle.MaxMomentumNum);
                dsItem.PushIntoStack(combatEmbattle.AbilityID);
                dsItem.PushIntoStack(combatEmbattle.GeneralLv);
                dsItem.PushIntoStack((short)isDefWait);
                // 增加佣兵品质
                var general = _cacheSetGeneral.FindKey(combatEmbattle.GeneralID);
                dsItem.PushShortIntoStack(general == null ? 0 : general.GeneralQuality.ToShort());

                PushIntoStack(dsItem);
            }
            //战斗过程
            PushIntoStack(combatProcessList.ProcessList.Count);
            foreach (CombatProcess combatProcess in combatProcessList.ProcessList)
            {
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(combatProcess.GeneralID);
                dsItem.PushIntoStack(combatProcess.LiveNum);
                dsItem.PushIntoStack(combatProcess.Momentum);
                dsItem.PushIntoStack(combatProcess.AttackTaget.ToShort());
                dsItem.PushIntoStack(combatProcess.AttackUnit.ToShort());
                dsItem.PushIntoStack(combatProcess.AbilityProperty.ToShort());
                dsItem.PushIntoStack(combatProcess.AttStatus.ToShort());
                dsItem.PushIntoStack(combatProcess.DamageNum);
                dsItem.PushIntoStack(combatProcess.AttEffectID.ToNotNullString());
                dsItem.PushIntoStack(combatProcess.TargetEffectID.ToNotNullString());
                dsItem.PushIntoStack(combatProcess.IsMove.ToShort());
                dsItem.PushIntoStack(combatProcess.Position.ToShort());
                dsItem.PushIntoStack(combatProcess.Role.ToShort());


                dsItem.PushIntoStack(combatProcess.DamageStatusList.Count);
                foreach (AbilityEffectStatus effectStatus in combatProcess.DamageStatusList)
                {
                    DataStruct dsItem1 = new DataStruct();
                    dsItem1.PushIntoStack(effectStatus.AbilityType.ToShort());
                    dsItem1.PushIntoStack(effectStatus.DamageNum);
                    dsItem1.PushIntoStack(effectStatus.IsIncrease ? 1 : 0);

                    dsItem.PushIntoStack(dsItem1);
                }

                dsItem.PushIntoStack(combatProcess.TargetList.Count);
                foreach (TargetProcess targetProcess in combatProcess.TargetList)
                {
                    DataStruct dsItem1 = new DataStruct();
                    dsItem1.PushIntoStack(targetProcess.GeneralID);
//.........这里部分代码省略.........
开发者ID:daneric,项目名称:Scut-samples,代码行数:101,代码来源:Action4004.cs

示例2: BuildPacket

        public override void BuildPacket()
        {
            this.PushIntoStack(_uSportsCombat == null ? LanguageManager.GetLang().shortInt : _uSportsCombat.IsWin.ToShort());
            this.PushIntoStack(_uSportsCombat == null ? 0 : _uSportsCombat.RewardGoin);
            this.PushIntoStack(_uSportsCombat == null ? 0 : _uSportsCombat.RewardObtian);
            //攻方阵形
            this.PushIntoStack(_combatProcessList.AttackList.Count);
            foreach (CombatEmbattle combatEmbattle in _combatProcessList.AttackList)
            {
                var general = _cacheSetGeneral.FindKey(combatEmbattle.GeneralID);
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(combatEmbattle.GeneralID);
                dsItem.PushIntoStack(combatEmbattle.GeneralName.ToNotNullString());
                //dsItem.PushIntoStack(combatEmbattle.BattleHead.ToNotNullString());
                dsItem.PushIntoStack(general == null ? string.Empty : general.BattleHeadID.ToNotNullString());
                dsItem.PushIntoStack(combatEmbattle.Position.ToShort());
                dsItem.PushIntoStack(combatEmbattle.LiveNum);
                dsItem.PushIntoStack(combatEmbattle.LiveMaxNum);
                dsItem.PushIntoStack(combatEmbattle.MomentumNum);
                dsItem.PushIntoStack(combatEmbattle.MaxMomentumNum);
                dsItem.PushIntoStack(combatEmbattle.AbilityID);
                dsItem.PushIntoStack(combatEmbattle.GeneralLv);
                dsItem.PushIntoStack(combatEmbattle.IsWait ? (short)1 : (short)0);
                // 增加佣兵品质
                dsItem.PushShortIntoStack(general == null ? 0 : general.GeneralQuality.ToShort());
                this.PushIntoStack(dsItem);
            }
            //防方阵形
            this.PushIntoStack(_combatProcessList.DefenseList.Count);
            foreach (CombatEmbattle combatEmbattle in _combatProcessList.DefenseList)
            {
                var general = _cacheSetGeneral.FindKey(combatEmbattle.GeneralID);
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(combatEmbattle.GeneralID);
                dsItem.PushIntoStack(combatEmbattle.GeneralName.ToNotNullString());
                dsItem.PushIntoStack(general == null ? string.Empty : general.BattleHeadID.ToNotNullString());
                //dsItem.PushIntoStack(combatEmbattle.BattleHead.ToNotNullString());
                dsItem.PushIntoStack(combatEmbattle.Position.ToShort());
                dsItem.PushIntoStack(combatEmbattle.LiveNum);
                dsItem.PushIntoStack(combatEmbattle.LiveMaxNum);
                dsItem.PushIntoStack(combatEmbattle.MomentumNum);
                dsItem.PushIntoStack(combatEmbattle.MaxMomentumNum);
                dsItem.PushIntoStack(combatEmbattle.AbilityID);
                dsItem.PushIntoStack(combatEmbattle.GeneralLv);
                dsItem.PushIntoStack(combatEmbattle.IsWait ? (short)1 : (short)0);
                // 增加佣兵品质
                dsItem.PushShortIntoStack(general == null ? 0 : general.GeneralQuality.ToShort());
                this.PushIntoStack(dsItem);
            }
            //战斗过程
            this.PushIntoStack(_combatProcessList.ProcessList.Count);
            foreach (CombatProcess combatProcess in _combatProcessList.ProcessList)
            {
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(combatProcess.GeneralID);
                dsItem.PushIntoStack(combatProcess.LiveNum);
                dsItem.PushIntoStack(combatProcess.Momentum);
                dsItem.PushIntoStack(combatProcess.AttackTaget.ToShort());
                dsItem.PushIntoStack(combatProcess.AttackUnit.ToShort());
                dsItem.PushIntoStack(combatProcess.AbilityProperty.ToShort());
                dsItem.PushIntoStack(combatProcess.AttStatus.ToShort());
                dsItem.PushIntoStack(combatProcess.DamageNum);
                dsItem.PushIntoStack(combatProcess.AttEffectID.ToNotNullString());
                dsItem.PushIntoStack(combatProcess.TargetEffectID.ToNotNullString());
                dsItem.PushIntoStack(combatProcess.IsMove.ToShort());
                dsItem.PushIntoStack(combatProcess.Position.ToShort());
                dsItem.PushIntoStack(combatProcess.Role.ToShort());

                dsItem.PushIntoStack(combatProcess.DamageStatusList.Count);
                foreach (AbilityEffectStatus effectStatus in combatProcess.DamageStatusList)
                {
                    DataStruct dsItem2 = new DataStruct();
                    dsItem2.PushIntoStack(effectStatus.AbilityType.ToShort());
                    dsItem2.PushIntoStack(effectStatus.DamageNum);
                    dsItem2.PushIntoStack(effectStatus.IsIncrease ? 1 : 0);

                    dsItem.PushIntoStack(dsItem2);
                }

                dsItem.PushIntoStack(combatProcess.TargetList.Count);
                foreach (TargetProcess targetProcess in combatProcess.TargetList)
                {
                    DataStruct dsItem1 = new DataStruct();
                    dsItem1.PushIntoStack(targetProcess.GeneralID);
                    dsItem1.PushIntoStack(targetProcess.LiveNum);
                    dsItem1.PushIntoStack(targetProcess.Momentum);
                    dsItem1.PushIntoStack(targetProcess.DamageNum);
                    dsItem1.PushIntoStack(targetProcess.IsShanBi.ToShort());
                    dsItem1.PushIntoStack(targetProcess.IsGeDang.ToShort());
                    dsItem1.PushIntoStack(targetProcess.IsBack.ToShort());
                    dsItem1.PushIntoStack(targetProcess.IsMove.ToShort());
                    dsItem1.PushIntoStack(targetProcess.BackDamageNum);
                    dsItem1.PushIntoStack(targetProcess.TargetStatus.ToShort());
                    dsItem1.PushIntoStack(targetProcess.Position.ToShort());
                    dsItem1.PushIntoStack(targetProcess.Role.ToShort());
                    //目标中招效果
                    dsItem1.PushIntoStack(targetProcess.DamageStatusList.Count);
                    foreach (AbilityEffectStatus effectStatus in targetProcess.DamageStatusList)
                    {
                        DataStruct dsItem12 = new DataStruct();
//.........这里部分代码省略.........
开发者ID:0jpq0,项目名称:Scut,代码行数:101,代码来源:Action5107.cs

示例3: BuildPacket

        public override void BuildPacket()
        {
            PushIntoStack(_userMagicArray.Count);
            foreach (UserMagic userMagic in _userMagicArray)
            {
                MagicInfo magicInfo = new ConfigCacheSet<MagicInfo>().FindKey(userMagic.MagicID);
                short repostion = GeneralHelper.ReplacePostion(ContextUser.UserID, userMagic.MagicID);
                DataStruct ds = new DataStruct();
                ds.PushIntoStack(userMagic.MagicID);
                ds.PushIntoStack(magicInfo == null ? string.Empty : magicInfo.MagicName.ToNotNullString());
                ds.PushIntoStack((short)userMagic.MagicLv);
                ds.PushIntoStack(userMagic.IsEnabled == false ? 0 : 1);
                ds.PushIntoStack(magicInfo == null ? string.Empty : magicInfo.MagicDesc.ToNotNullString());
                string gridPostion = string.Empty;
                string[] gridRanges = new string[0];
                MagicLvInfo magicLv = new ConfigCacheSet<MagicLvInfo>().FindKey(userMagic.MagicID, userMagic.MagicLv);
                if (magicLv != null)
                {
                    var userFunction = new GameDataCacheSet<UserFunction>().FindKey(ContextUser.UserID, FunctionEnum.ReplaceGeneral);
                    gridPostion = magicLv.GridRange;
                    if (magicLv.ReplacePostion > 0 && userFunction != null)
                    {
                        gridPostion = gridPostion.TrimEnd(',') + "," + magicLv.ReplacePostion;
                    }
                }
                gridRanges = gridPostion.Split(',');
                ds.PushIntoStack(gridRanges.Length);

                foreach (string gridRang in gridRanges)
                {
                    int isDisplace = repostion == gridRang.ToInt() ? 1 : 0;
                    UserEmbattle userEmbattle = new GameDataCacheSet<UserEmbattle>().FindKey(ContextUser.UserID, userMagic.MagicID, gridRang.ToShort());
                    UserGeneral uGeneral = new GameDataCacheSet<UserGeneral>().FindKey(ContextUser.UserID, userEmbattle == null ? 0 : userEmbattle.GeneralID);

                    DataStruct ds1 = new DataStruct();
                    ds1.PushIntoStack(uGeneral == null ? (short)0 : (short)1);
                    ds1.PushIntoStack(gridRang.ToShort());
                    ds1.PushIntoStack(uGeneral == null ? 0 : uGeneral.GeneralID);
                    ds1.PushIntoStack(uGeneral == null ? string.Empty : uGeneral.HeadID.ToNotNullString());
                    ds1.PushIntoStack((short)isDisplace);
                    ds1.PushShortIntoStack(uGeneral == null ? (short)0 : MathUtils.ToShort(uGeneral.GeneralQuality));
                    ds.PushIntoStack(ds1);
                }
                PushIntoStack(ds);
            }
            // 获取佣兵品质
            var generalInfoCacheSet = new ShareCacheStruct<GeneralInfo>();
            PushIntoStack(_userGeneralArray.Count);
            foreach (UserGeneral general in _userGeneralArray)
            {
                GeneralInfo generalInfo = generalInfoCacheSet.FindKey(general.GeneralID);
                DataStruct ds = new DataStruct();
                ds.PushIntoStack(general.GeneralID);
                ds.PushIntoStack(general.HeadID.ToNotNullString());
                ds.PushShortIntoStack(generalInfo == null ? (short)0 : MathUtils.ToShort(generalInfo.GeneralQuality));
                PushIntoStack(ds);
            }
        }
开发者ID:jinfei426,项目名称:Scut,代码行数:58,代码来源:Action1901.cs


注:本文中的ZyGames.Framework.Game.Service.DataStruct.PushShortIntoStack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。