Beispiel #1
0
        public override sealed bool SetParam(ConditionParameters param, int value)
        {
            bool ret = base.SetParam(param, value);

            switch (param)
            {
            case ConditionParameters.HealthGain:
                HealthGain = (uint)value;
                return(true);

            case ConditionParameters.HealthTicks:
                HealthTicks = (uint)value;
                return(true);

            case ConditionParameters.ManaGain:
                ManaGain = (uint)value;
                return(true);

            case ConditionParameters.ManaTicks:
                ManaTicks = (uint)value;
                return(true);

            default:
                return(ret);
            }
        }
Beispiel #2
0
        public string DownLoadTxtByExec(ConditionParameters ps, string path, string procedure_Name)
        {
            string returnPath       = string.Empty;
            string connectionString = ConfigurationManager.ConnectionStrings[ApplicationSettingsFactory.GetApplicationSettings().DBConnectionName].ConnectionString; //获得Web.config中的连接字符串

            using (SqlConnection conStr = new SqlConnection(connectionString))                                                                                       //SQL数据库连接对象,以数据库链接字符串为参数
            {
                SqlCommand comStr = new SqlCommand(procedure_Name, conStr);                                                                                          //SQL语句执行对象,第一个参数是要执行的语句,第二个是数据库连接对象
                comStr.CommandType = CommandType.StoredProcedure;                                                                                                    //因为要使用的是存储过程,所以设置执行类型为存储过程
                //依次设定存储过程的参数
                for (int i = 0; i < ps.PointsNumberIds.Length; i++)
                {
                    string para = string.Concat("@MPN", i + 1);
                    comStr.Parameters.Add(para, SqlDbType.Int).Value = ps.PointsNumberIds[i];
                }
                comStr.Parameters.Add("@StartTime", SqlDbType.DateTime).Value          = ps.StarTime;
                comStr.Parameters.Add("@EndTime", SqlDbType.DateTime).Value            = ps.EndTime;
                comStr.Parameters.Add("@filePath_name", SqlDbType.VarChar, 8000).Value = path;
                //定义一个输出参数,不需赋值。Direction用来描述参数的类型
                //Direction默认为输入参数,还有输出参数和返回值型。
                SqlParameter txtPath = comStr.Parameters.Add("@TxtPath", SqlDbType.VarChar, 8000);
                txtPath.Direction = ParameterDirection.Output;
                conStr.Open();                                               //打开数据库连接
                comStr.ExecuteNonQuery().ToString();                         //执行存储过程
                returnPath = comStr.Parameters["@TxtPath"].Value.ToString(); //在执行完存储过程之后,可得到输出参数
            }
            return(returnPath);
        }
        private ConditionParameters DealWithConditionParameter(DatasQueryResultRequestBase req)
        {
            ConditionParameters ps = new ConditionParameters();

            ps.EndTime         = req.EndTime;
            ps.StarTime        = req.StartTime;
            ps.PointsNumberIds = req.PointsNumberIds;
            return(ps);
        }
Beispiel #4
0
        public override sealed bool SetParam(ConditionParameters param, int value)
        {
            base.SetParam(param, value);
            if (param != ConditionParameters.Speed)
            {
                return(false);
            }

            SpeedDelta    = value;
            ConditionType = value > 0 ? ConditionFlags.Haste : ConditionFlags.Paralyze;
            return(true);
        }
Beispiel #5
0
        public override sealed bool SetParam(ConditionParameters param, int value)
        {
            bool ret = base.SetParam(param, value);

            switch (param)
            {
            case ConditionParameters.Owner:
                Owner = (uint)value;
                return(true);

            case ConditionParameters.ForceUpdate:
                ForceUpdate = (value != 0);
                return(true);

            case ConditionParameters.Delayed:
                Delayed = (value != 0);
                return(true);

            case ConditionParameters.MaxValue:
                MaxDamage = Math.Abs(value);
                break;

            case ConditionParameters.MinValue:
                MinDamage = Math.Abs(value);
                break;

            case ConditionParameters.StartValue:
                StartDamage = Math.Abs(value);
                break;

            case ConditionParameters.TickInterval:
                TickInterval = Math.Abs(value);
                break;

            case ConditionParameters.PeriodicDamage:
                PeriodDamage = value;
                break;

            case ConditionParameters.Field:
                Field = (value != 0);
                break;

            default:
                return(false);
            }

            return(ret);
        }
Beispiel #6
0
        public virtual bool SetParam(ConditionParameters param, int value)
        {
            switch (param)
            {
            case ConditionParameters.Ticks:
                Ticks = value;
                return(true);

            case ConditionParameters.BuffSpell:
                IsBuff = (value != 0);
                return(true);

            case ConditionParameters.SubID:
                SubId = (uint)value;
                return(true);

            default:
                return(false);
            }
        }
Beispiel #7
0
        public override sealed bool SetParam(ConditionParameters param, int value)
        {
            bool ret = base.SetParam(param, value);

            if (ret)
            {
                return(false);
            }

            switch (param)
            {
            case ConditionParameters.LightLevel:
                LightInfo.Level = (byte)value;
                return(true);

            case ConditionParameters.LightColor:
                LightInfo.Color = (byte)value;
                return(true);

            default:
                return(false);
            }
        }
Beispiel #8
0
        public override bool SetParam(ConditionParameters param, int value)
        {
            bool ret = base.SetParam(param, value);

            switch (param)
            {
            case ConditionParameters.SkillMelee:
                Skills[(byte)Enums.Skills.Club]  = value;
                Skills[(byte)Enums.Skills.Axe]   = value;
                Skills[(byte)Enums.Skills.Sword] = value;
                return(true);

            case ConditionParameters.SkillMeleePercent:
                SkillsPercent[(byte)Enums.Skills.Club]  = value;
                SkillsPercent[(byte)Enums.Skills.Axe]   = value;
                SkillsPercent[(byte)Enums.Skills.Sword] = value;
                return(true);

            case ConditionParameters.SkillFist:
                Skills[(byte)Enums.Skills.Fist] = value;
                return(true);

            case ConditionParameters.SkillFistPercent:
                SkillsPercent[(byte)Enums.Skills.Fist] = value;
                return(true);

            case ConditionParameters.SkillClub:
                Skills[(byte)Enums.Skills.Club] = value;
                return(true);

            case ConditionParameters.SkillClubPercent:
                SkillsPercent[(byte)Enums.Skills.Club] = value;
                return(true);

            case ConditionParameters.SkillSword:
                Skills[(byte)Enums.Skills.Sword] = value;
                return(true);

            case ConditionParameters.SkillSwordPercent:
                SkillsPercent[(byte)Enums.Skills.Sword] = value;
                return(true);

            case ConditionParameters.SkillAxe:
                Skills[(byte)Enums.Skills.Axe] = value;
                return(true);

            case ConditionParameters.SkillAxePercent:
                SkillsPercent[(byte)Enums.Skills.Axe] = value;
                return(true);

            case ConditionParameters.SkillDistance:
                Skills[(byte)Enums.Skills.Distance] = value;
                return(true);

            case ConditionParameters.SkillDistancePercent:
                SkillsPercent[(byte)Enums.Skills.Distance] = value;
                return(true);

            case ConditionParameters.SkillShield:
                Skills[(byte)Enums.Skills.Shield] = value;
                return(true);

            case ConditionParameters.SkillShieldPercent:
                SkillsPercent[(byte)Enums.Skills.Shield] = value;
                return(true);

            case ConditionParameters.SkillFishing:
                Skills[(byte)Enums.Skills.Fishing] = value;
                return(true);

            case ConditionParameters.SkillFishingPercent:
                SkillsPercent[(byte)Enums.Skills.Fishing] = value;
                return(true);

            case ConditionParameters.StatMaxHitPoints:
                Stats[(byte)Enums.Stats.MaxHitPoints] = value;
                return(true);

            case ConditionParameters.StatMaxManaPoints:
                Stats[(byte)Enums.Stats.MaxManaPoints] = value;
                return(true);

            case ConditionParameters.StatMagicPoints:
                Stats[(byte)Enums.Stats.MagicPoints] = value;
                return(true);

            case ConditionParameters.StatMaxHitPointsPercent:
                StatsPercent[(byte)Enums.Stats.MaxHitPoints] = Math.Max(0, value);
                return(true);

            case ConditionParameters.StatMaxManaPointsPercent:
                StatsPercent[(byte)Enums.Stats.MaxManaPoints] = Math.Max(0, value);
                return(true);

            case ConditionParameters.StatMagicPointsPercent:
                StatsPercent[(byte)Enums.Stats.MagicPoints] = Math.Max(0, value);
                return(true);

            default:
                return(ret);
            }
        }
Beispiel #9
0
 public ConditionResult(Condition condition, ConditionParameters parameters, ConditionResultType type)
 {
     Condition  = condition;
     Parameters = parameters;
     Type       = type;
 }