public override System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> ReadFields(System.IO.BinaryReader binaryReader) { System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(base.ReadFields(binaryReader)); this.ScenarioFunctionFlags = ((Flags)(binaryReader.ReadInt32())); this.Name = binaryReader.ReadString32(); this.Period = binaryReader.ReadSingle(); this.ScalePeriodBy = binaryReader.ReadShortBlockIndex1(); this.Function = ((FunctionEnum)(binaryReader.ReadInt16())); this.ScaleFunctionBy = binaryReader.ReadShortBlockIndex1(); this.WobbleFunction = ((WobbleFunctionEnum)(binaryReader.ReadInt16())); this.WobblePeriod = binaryReader.ReadSingle(); this.WobbleMagnitude = binaryReader.ReadSingle(); this.SquareWaveThreshold = binaryReader.ReadSingle(); this.StepCount = binaryReader.ReadInt16(); this.MapTo = ((MapToEnum)(binaryReader.ReadInt16())); this.SawtoothCount = binaryReader.ReadInt16(); this.fieldpad = binaryReader.ReadBytes(2); this.ScaleResultBy = binaryReader.ReadShortBlockIndex1(); this.BoundsMode = ((BoundsModeEnum)(binaryReader.ReadInt16())); this.Bounds = binaryReader.ReadVector2(); this.fieldpad0 = binaryReader.ReadBytes(4); this.fieldpad1 = binaryReader.ReadBytes(2); this.TurnOffWith = binaryReader.ReadShortBlockIndex1(); this.fieldpad2 = binaryReader.ReadBytes(16); this.fieldpad3 = binaryReader.ReadBytes(16); return(pointerQueue); }
/// <summary> /// 清空多人副本次数 /// </summary> /// <param name="userID"></param> /// <param name="plotID"></param> public static void RemoveDailyMorePlot(string userID, FunctionEnum activeType) { UserDailyRestrain dailyRestrain = new PersonalCacheStruct <UserDailyRestrain>().FindKey(userID); if (dailyRestrain != null && dailyRestrain.UserExtend != null) { if (dailyRestrain.UserExtend.MorePlot != null && dailyRestrain.UserExtend.MorePlot.Count > 0) { FunPlot funPlots = dailyRestrain.UserExtend.MorePlot[0]; if (funPlots != null) { DateTime endDate = funPlots.MoreDate.AddHours(1).ToString("yyyy-MM-dd HH:00:00").ToDateTime(); if (endDate < DateTime.Now && DateTime.Now > MorePlotEndDate(userID, activeType)) { dailyRestrain.UserExtend.UpdateNotify(obj => { if (dailyRestrain.UserExtend.MorePlot == null) { dailyRestrain.UserExtend.MorePlot = new CacheList <FunPlot>(); } dailyRestrain.UserExtend.MorePlot.Clear(); return(true); }); } } } } }
/// <summary> /// 可创建活动多人副本列表 /// </summary> /// <returns></returns> public MorePlot[] GetMorePlotFestivalList(FunctionEnum functionEnum) { List <MorePlot> morePlotsList = new List <MorePlot>(); var morePlotArray = new List <PlotInfo>(); if (functionEnum == FunctionEnum.MorePlotCoin) { morePlotArray = new ShareCacheStruct <PlotInfo>().FindAll(m => m.PlotType == PlotType.MorePlotCoin); } else if (functionEnum == FunctionEnum.MorePlotEnergy) { morePlotArray = new ShareCacheStruct <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()); }
/// <summary> /// 已开启的功能 /// </summary> /// <param name="userID"></param> /// <param name="funEnum"></param> /// <returns></returns> private static UserFunction GetUserFunction(string userID, FunctionEnum funEnum) { var cacheSet = new GameDataCacheSet<UserFunction>(); UserFunction function1 = cacheSet.FindKey(userID, funEnum); if (function1 != null) { return function1; } return null; }
public void Test_FunctionEnum() { foreach (FunctionEnum o in FunctionEnum.Options) { Assert("FunctionEnum could not be retrieved by ToInt32() value)", o.Equals(FunctionEnum.GetInstance(o.ToInt32()))); Assert("FunctionEnum could not be retrieved by Code)", o.Equals(FunctionEnum.GetInstance(o.Code))); } Assert("Function should have been invalid", !FunctionEnum.GetInstance("xxx").IsValid); Assert("Function should have been invalid", !FunctionEnum.GetInstance(-69).IsValid); }
public static float Lerp(float a, float b, float t, FunctionEnum function) { var func = FunctionDefinition.GetFunction(function); if (func != null) { float tChanged = func.Invoke(t); return(Mathf.Lerp(a, b, tChanged)); } return(0); }
/// <summary> /// 已开启的功能 /// </summary> /// <param name="userID"></param> /// <param name="funEnum"></param> /// <returns></returns> private static UserFunction GetUserFunction(string userID, FunctionEnum funEnum) { var cacheSet = new PersonalCacheStruct <UserFunction>(); UserFunction function1 = cacheSet.FindKey(userID, funEnum); if (function1 != null) { return(function1); } return(null); }
public Function(string function, string[] ids, ParsTreeNode parent) : base(function, ids, parent) { foreach (string func in Enum.GetNames(typeof(FunctionEnum))) { if (function.ToLower().StartsWith(func.ToLower())) { Func = (FunctionEnum)Enum.Parse(typeof(FunctionEnum), func); this.Term = new Term(function.Substring(func.Length), ids, this); break; } } }
/// <summary> /// 获取公式字符串 /// </summary> /// <param name="workbook"></param> /// <param name="worksheet"></param> /// <param name="functionEnum"></param> /// <param name="fromRowIndex"></param> /// <param name="toRowIndex"></param> /// <param name="fromColumnIndex"></param> /// <param name="toColumnIndex"></param> /// <returns></returns> private string GetCellFormula(TWorkbook workbook, TSheet worksheet, FunctionEnum functionEnum, int fromRowIndex, int toRowIndex, int fromColumnIndex, int toColumnIndex) { string startAddress = GetCellAddress(workbook, worksheet, fromRowIndex, fromColumnIndex); string endAddress = GetCellAddress(workbook, worksheet, toRowIndex, toColumnIndex); string formula = null; switch (functionEnum) { case FunctionEnum.None: { formula = null; break; } case FunctionEnum.Sum: { formula = $"SUM({startAddress}:{endAddress})"; break; } case FunctionEnum.Avg: { formula = $"AVERAGE({startAddress}:{endAddress})"; break; } case FunctionEnum.Count: { formula = $"COUNT({startAddress}:{endAddress})"; break; } case FunctionEnum.Max: { formula = $"MAX({startAddress}:{endAddress})"; break; } case FunctionEnum.Min: { formula = $"MIN({startAddress}:{endAddress})"; break; } default: throw new Exception($"函数类型值【{functionEnum}】还未设置公式"); } return(formula); }
/// <summary> /// 多人副本结束时间 /// </summary> /// <param name="function"></param> /// <returns></returns> public static DateTime MorePlotEndDate(string userID, FunctionEnum activeType) { DateTime enableTime = new DateTime(); GameActive[] gameActivesArray = new List <GameActive>(new GameActiveCenter(userID).GetActiveList()).FindAll(m => m.ActiveType == activeType).ToArray(); if (gameActivesArray.Length > 0) { GameActive active = gameActivesArray[0]; if (active != null) { enableTime = active.EndTime; } } return(enableTime); }
public async Task<IActionResult> Renew (FunctionEnum gonneng,string Id,CustDetailVM vm,string Enddate) { var Cust = await RepositoryWrapper.CustMast.FirstorDefaultAsync(X=>X.Cid==Id); //期限判斷 DateTime startdate=DateTime.Now; //期限判斷 //功能判斷 string Function=gonneng.ToString().Equals("基本型")?"BR":"BCLER"; //功能判斷 Cust.Renew=startdate.ToString("yyyy/MM/dd"); Cust.Enddate=vm.Enddate.ToString("yyyy/MM/dd"); await RepositoryWrapper.CustMast.UpdateAsync(Cust); return RedirectToAction("Details",new{Id=Id}); }
/// <summary> /// 是否多人副本时间 /// </summary> /// <param name="function"></param> /// <returns></returns> public static bool IsMorePlotDate(string userID, FunctionEnum activeType) { DateTime beginTime = new DateTime(); DateTime enableTime = new DateTime(); GameActive[] gameActivesArray = new List <GameActive>(new GameActiveCenter(userID).GetActiveList()).FindAll(m => m.ActiveType == activeType).ToArray(); foreach (GameActive gameActive in gameActivesArray) { beginTime = gameActive.BeginTime; enableTime = gameActive.EndTime; if (DateTime.Now > beginTime && DateTime.Now < enableTime) { return(true); } } return(false); }
private void Process(string userID, int fun) { FunctionEnum funEnum = fun.ToEnum <FunctionEnum>(); var cacheSet = new GameDataCacheSet <UserFunction>(); UserFunction userFunction = cacheSet.FindKey(UserID, funEnum); if (userFunction == null) { userFunction = new UserFunction() { UserID = userID, FunEnum = funEnum, CreateDate = DateTime.Now }; cacheSet.Add(userFunction); } }
public void Translate(Vector3 translateVector, FunctionEnum function = FunctionEnum.Linear) { Vector3 newVector = GetCurrentValue() + translateVector; if (useLimitX) { newVector.x = isPercent ? MathfExtend.Lerp(rangeX, translateVector.x, function) : MathfExtend.Clamp(newVector.x, rangeX); } if (useLimitY) { newVector.y = isPercent ? MathfExtend.Lerp(rangeY, translateVector.y, function) : MathfExtend.Clamp(newVector.y, rangeY); } if (useLimitZ) { newVector.z = isPercent ? MathfExtend.Lerp(rangeZ, translateVector.z, function) : MathfExtend.Clamp(newVector.z, rangeZ); } SetCurrentValue(newVector); }
public GameActive[] GetActiveList(FunctionEnum activeType) { List <GameActive> activeList = new List <GameActive>(); foreach (var gameActive in _gameActiveList) { if (gameActive.ActiveType != FunctionEnum.Gonghui && (gameActive.ActiveType != activeType || new PersonalCacheStruct <UserFunction>().FindKey(_userId, gameActive.ActiveType) == null)) { continue; } activeList.Add(gameActive); if (activeType == FunctionEnum.Gonghui) { if (gameActive.ActiveType == FunctionEnum.Gonghui) { GameUser userInfo = new PersonalCacheStruct <GameUser>().FindKey(_userId); if (userInfo != null) { UserGuild guild = new ShareCacheStruct <UserGuild>().FindKey(userInfo.MercenariesID); if (guild != null) { GuildLvInfo lvInfo = new ShareCacheStruct <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()); }
protected override Expression VisitMethodCall(MethodCallExpression node) { if (node.Method.DeclaringType == typeof(Queryable) && node.Method.Name == "Where") { var predicate = node.Arguments[1]; Visit(predicate); return(node); } if (node.Method.DeclaringType == typeof(string)) { var memberExpression = node.Object as MemberExpression; if (memberExpression != null) { resultString.Append(memberExpression.Member.Name).Append(":"); } IDictionary <string, FunctionEnum> methodsMapper = new Dictionary <string, FunctionEnum>(); foreach (FunctionEnum functionEnum in Enum.GetValues(typeof(FunctionEnum))) { methodsMapper.Add(functionEnum.ToString(), functionEnum); } currentFunction = methodsMapper[node.Method.Name]; resultString.Append("("); var predicate = node.Arguments[0]; Visit(predicate); resultString.Append(")"); queryStrings.Add(resultString.ToString()); resultString.Clear(); return(node); } return(base.VisitMethodCall(node)); }
protected override object this[string index] { get { #region switch (index) { case "UserID": return(UserID); case "FunEnum": return(FunEnum); case "CreateDate": return(CreateDate); default: throw new ArgumentException(string.Format("UserFunction index[{0}] isn't exist.", index)); } #endregion } set { #region switch (index) { case "UserID": _UserID = value.ToNotNullString(); break; case "FunEnum": _FunEnum = value.ToEnum <FunctionEnum>(); break; case "CreateDate": _CreateDate = value.ToDateTime(); break; default: throw new ArgumentException(string.Format("UserFunction index[{0}] isn't exist.", index)); } #endregion } }
protected override Expression VisitBinary(BinaryExpression node) { switch (node.NodeType) { case ExpressionType.Equal: currentFunction = FunctionEnum.None; if (node.Left.NodeType == ExpressionType.MemberAccess && node.Right.NodeType == ExpressionType.Constant) { Visit(node.Left); resultString.Append("("); Visit(node.Right); resultString.Append(")"); queryStrings.Add(resultString.ToString()); resultString.Clear(); } else { Visit(node.Right); resultString.Append("("); Visit(node.Left); resultString.Append(")"); queryStrings.Add(resultString.ToString()); resultString.Clear(); } break; case ExpressionType.AndAlso: Visit(node.Left); Visit(node.Right); break; default: throw new NotSupportedException($"Operation {node.NodeType} is not supported"); } ; return(node); }
public GameActive[] GetActiveList(FunctionEnum activeType) { List<GameActive> activeList = new List<GameActive>(); foreach (var gameActive in _gameActiveList) { if (gameActive.ActiveType != FunctionEnum.Gonghui && (gameActive.ActiveType != activeType || new PersonalCacheStruct<UserFunction>().FindKey(_userId, gameActive.ActiveType) == null)) continue; activeList.Add(gameActive); if (activeType == FunctionEnum.Gonghui) { if (gameActive.ActiveType == FunctionEnum.Gonghui) { GameUser userInfo = new PersonalCacheStruct<GameUser>().FindKey(_userId); if (userInfo != null) { UserGuild guild = new ShareCacheStruct<UserGuild>().FindKey(userInfo.MercenariesID); if (guild != null) { GuildLvInfo lvInfo = new ShareCacheStruct<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(); }
protected override object this[string index] { get { #region switch (index) { case "ActiveId": return(ActiveId); case "ActiveName": return(ActiveName); case "HeadID": return(HeadID); case "Descption": return(Descption); case "ActiveType": return(ActiveType); case "BossDefLv": return(BossDefLv); case "BossLv": return(BossLv); case "BossPlotID": return(BossPlotID); case "EnablePeriod": return(EnablePeriod); case "WaitMinutes": return(WaitMinutes); case "Minutes": return(Minutes); case "ActivePize": return(ActivePize); case "State": return(State); case "Broadcast": return(Broadcast); case "ActiveStyle": return(ActiveStyle); default: throw new ArgumentException(string.Format("GameActive index[{0}] isn't exist.", index)); } #endregion } set { #region switch (index) { case "ActiveId": _ActiveId = value.ToInt(); break; case "ActiveName": _ActiveName = value.ToNotNullString(); break; case "HeadID": _HeadID = value.ToNotNullString(); break; case "Descption": _Descption = value.ToNotNullString(); break; case "ActiveType": _ActiveType = value.ToEnum <FunctionEnum>(); break; case "BossDefLv": _BossDefLv = value.ToInt(); break; case "BossLv": _BossLv = value.ToShort(); break; case "BossPlotID": _BossPlotID = value.ToInt(); break; case "EnablePeriod": _EnablePeriod = value.ToNotNullString(); break; case "WaitMinutes": _WaitMinutes = value.ToInt(); break; case "Minutes": _Minutes = value.ToInt(); break; case "ActivePize": _ActivePize = value.ToNotNullString(); break; case "State": _State = value.ToBool(); break; case "Broadcast": _Broadcast = value.ToNotNullString(); break; case "ActiveStyle": _ActiveStyle = value.ToShort(); break; default: throw new ArgumentException(string.Format("GameActive index[{0}] isn't exist.", index)); } #endregion } }
public FunctionsCondition(ConditionTargetEnum target, FunctionsConditionEnum doing, FunctionEnum function) { ConditionTarget = target; Condition = doing; Function = function; }
/// <summary> /// 是否多人副本时间 /// </summary> /// <param name="function"></param> /// <returns></returns> public static bool IsMorePlotDate(string userID, FunctionEnum activeType) { DateTime beginTime = new DateTime(); DateTime enableTime = new DateTime(); GameActive[] gameActivesArray = new List<GameActive>(new GameActiveCenter(userID).GetActiveList()).FindAll(m => m.ActiveType == activeType).ToArray(); foreach (GameActive gameActive in gameActivesArray) { beginTime = gameActive.BeginTime; enableTime = gameActive.EndTime; if (DateTime.Now > beginTime && DateTime.Now < enableTime) { return true; } } return false; }
private void PlotGeneratedData(List <ulong> xs, double slope, double intercept, Brush brush, FunctionEnum fitType) { if (double.IsNaN(slope) || double.IsNaN(intercept)) { Console.WriteLine($"Bad slope {slope} and/or intercept {intercept} "); return; } List <double> modifiedXs = new List <double>(); string title = "Unknown"; switch (fitType) { case FunctionEnum.N: title = "Linear Fit"; modifiedXs = ModifyData(xs, p => p); break; case FunctionEnum.NSquared: title = "Quadratic Fit"; modifiedXs = ModifyData(xs, p => p * p); break; case FunctionEnum.TwoToTheN: title = "2^N"; modifiedXs = ModifyData(xs, p => Math.Pow(2, p)); break; case FunctionEnum.NCubed: title = "Cubit Fit"; modifiedXs = ModifyData(xs, p => p * p * p); break; case FunctionEnum.LogN: title = "LogN Fit"; modifiedXs = ModifyData(xs, p => Math.Log(p)); break; } ChartValues <ObservablePoint> linearData = new ChartValues <ObservablePoint>(); for (int i = 0; i < modifiedXs.Count; i++) { linearData.Add(new ObservablePoint(xs[i], modifiedXs[i] * slope + intercept)); } SeriesCollection.Add(new LineSeries { Title = title, Values = linearData, LineSmoothness = 0, PointForeground = brush }); }
/// <summary> /// 功能是否开启 /// </summary> /// <param name="userID"></param> /// <param name="funEnum"></param> /// <returns></returns> public static bool IsOpenFunction(string userID, FunctionEnum funEnum) { var cacheSet = new GameDataCacheSet<UserFunction>(); UserFunction function = cacheSet.FindKey(userID, funEnum); if (function != null) { return true; } return false; }
public static Vector4 Lerp(Vector2 rangeX, Vector2 rangeY, Vector2 rangeZ, Vector2 rangeW, Vector4 t, FunctionEnum function = FunctionEnum.Linear) { Vector4 vector; vector.x = MathfExtend.Lerp(rangeX.x, rangeX.y, t.x, function); vector.y = MathfExtend.Lerp(rangeY.x, rangeY.y, t.y, function); vector.z = MathfExtend.Lerp(rangeZ.x, rangeZ.y, t.z, function); vector.w = MathfExtend.Lerp(rangeW.x, rangeW.y, t.w, function); return(vector); }
public static Vector4 Lerp(Vector2 rangeX, Vector2 rangeY, Vector2 rangeZ, Vector2 rangeW, float t, FunctionEnum function = FunctionEnum.Linear) { return(Lerp(rangeX, rangeY, rangeZ, rangeW, Vector4.one * t, function)); }
/// <summary> /// 初始化权限判断过滤器 /// </summary> /// <param name="menu">菜单编号</param> /// <param name="role">功能英文名</param> public UsersRoleAuthFilterAttribute(string menu, FunctionEnum role) { _menu = menu; _role = role.ToString().Split(","); }
/// <summary> /// 开启功能[未完成] /// </summary> /// <param name="user"></param> /// <param name="functionEnum"></param> public static void EnableFunction(GameUser user, FunctionEnum functionEnum) { if (functionEnum <= 0) { return; } var cacheSet = new GameDataCacheSet<UserFunction>(); UserFunction uf = cacheSet.FindKey(user.UserID, functionEnum); if (uf == null) { uf = new UserFunction { UserID = user.UserID, FunEnum = functionEnum, CreateDate = DateTime.Now }; cacheSet.Add(uf); uf = cacheSet.FindKey(user.UserID, functionEnum); } switch (functionEnum) { //case FunctionEnum.Qianghuaqueue: // user.QueueNum = 2; // user.Update(); // break; case FunctionEnum.Qianghua: user.QueueNum = (short)new GameUser().QueueMinNum; //user.Update(); break; case FunctionEnum.Shengmishangdian: UserHelper.RefrshShopsSparData(user, false); break; case FunctionEnum.Mofazheng: InitMagicEmbattle(user.UserID, user.UserLv); break; case FunctionEnum.Zhongzhijiyangshu: GetUserLand(user.UserID); break; case FunctionEnum.Zhongzhijingqianshu: GoinUserQueue(user.UserID); break; case FunctionEnum.Enchant: EnchantHelper.EnchantFunctionOpen(user); break; case FunctionEnum.ReplaceGeneral: GeneralHelper.OpenReplaceGeneral(user); break; default: break; } }
protected override object this[string index] { get { #region switch (index) { case "TaskID": return(TaskID); case "TaskType": return(TaskType); case "PreTaskID": return(PreTaskID); case "CountryID": return(CountryID); case "TaskName": return(TaskName); case "TaskDescp": return(TaskDescp); case "ReleaseNpcID": return(ReleaseNpcID); case "ReleaseDialogue": return(ReleaseDialogue); case "TakedDialogue": return(TakedDialogue); case "DeliveryNpcID": return(DeliveryNpcID); case "DeliveryDialogue": return(DeliveryDialogue); case "TaskLv": return(TaskLv); case "TermsType": return(TermsType); case "PlotID": return(PlotID); case "PlotNpcID": return(PlotNpcID); case "TargetMonsterID": return(TargetMonsterID); case "TargetMonsterNum": return(TargetMonsterNum); case "TargetItemID": return(TargetItemID); case "TargetItemNum": return(TargetItemNum); case "FunctionEnum": return(FunctionEnum); case "Experience": return(Experience); case "GameCoin": return(GameCoin); case "EnablePlot": return(EnablePlot); case "Version": return(Version); case "GeneralID": return(GeneralID); case "Reward": return(Reward); default: throw new ArgumentException(string.Format("StoryTaskInfo index[{0}] isn't exist.", index)); } #endregion } set { #region switch (index) { case "TaskID": _TaskID = value.ToInt(); break; case "TaskType": _TaskType = value.ToEnum <TaskType>(); break; case "PreTaskID": _PreTaskID = value as int[] ?? new int[0]; break; case "CountryID": _CountryID = value.ToEnum <CountryType>(); break; case "TaskName": _TaskName = value.ToNotNullString(); break; case "TaskDescp": _TaskDescp = value.ToNotNullString(); break; case "ReleaseNpcID": _ReleaseNpcID = value.ToInt(); break; case "ReleaseDialogue": _ReleaseDialogue = ConvertCustomField <CacheList <DialogueInfo> >(value, index); break; case "TakedDialogue": _TakedDialogue = ConvertCustomField <CacheList <DialogueInfo> >(value, index); break; case "DeliveryNpcID": _DeliveryNpcID = value.ToInt(); break; case "DeliveryDialogue": _DeliveryDialogue = ConvertCustomField <CacheList <DialogueInfo> >(value, index); break; case "TaskLv": _TaskLv = value.ToShort(); break; case "TermsType": _TermsType = value.ToEnum <PlotTermsType>(); break; case "PlotID": _PlotID = value.ToInt(); break; case "PlotNpcID": _PlotNpcID = value.ToInt(); break; case "TargetMonsterID": _TargetMonsterID = value.ToNotNullString(); break; case "TargetMonsterNum": _TargetMonsterNum = value.ToNotNullString(); break; case "TargetItemID": _TargetItemID = value.ToInt(); break; case "TargetItemNum": _TargetItemNum = value.ToInt(); break; case "FunctionEnum": _FunctionEnum = value.ToEnum <FunctionEnum>(); break; case "Experience": _Experience = value.ToInt(); break; case "GameCoin": _GameCoin = value.ToInt(); break; case "EnablePlot": _EnablePlot = value.ToNotNullString(); break; case "Version": _Version = value.ToInt(); break; case "GeneralID": _GeneralID = value.ToInt(); break; case "Reward": _Reward = ConvertCustomField <CacheList <PrizeInfo> >(value, index); break; default: throw new ArgumentException(string.Format("StoryTaskInfo index[{0}] isn't exist.", index)); } #endregion } }
protected override object this[string index] { get { #region switch (index) { case "ActiveId": return ActiveId; case "ActiveName": return ActiveName; case "HeadID": return HeadID; case "Descption": return Descption; case "ActiveType": return ActiveType; case "BossDefLv": return BossDefLv; case "BossLv": return BossLv; case "BossPlotID": return BossPlotID; case "EnablePeriod": return EnablePeriod; case "WaitMinutes": return WaitMinutes; case "Minutes": return Minutes; case "ActivePize": return ActivePize; case "State": return State; case "Broadcast": return Broadcast; case "ActiveStyle": return ActiveStyle; default: throw new ArgumentException(string.Format("GameActive index[{0}] isn't exist.", index)); } #endregion } set { #region switch (index) { case "ActiveId": _ActiveId = value.ToInt(); break; case "ActiveName": _ActiveName = value.ToNotNullString(); break; case "HeadID": _HeadID = value.ToNotNullString(); break; case "Descption": _Descption = value.ToNotNullString(); break; case "ActiveType": _ActiveType = value.ToEnum<FunctionEnum>(); break; case "BossDefLv": _BossDefLv = value.ToInt(); break; case "BossLv": _BossLv = value.ToShort(); break; case "BossPlotID": _BossPlotID = value.ToInt(); break; case "EnablePeriod": _EnablePeriod = value.ToNotNullString(); break; case "WaitMinutes": _WaitMinutes = value.ToInt(); break; case "Minutes": _Minutes = value.ToInt(); break; case "ActivePize": _ActivePize = value.ToNotNullString(); break; case "State": _State = value.ToBool(); break; case "Broadcast": _Broadcast = value.ToNotNullString(); break; case "ActiveStyle": _ActiveStyle = value.ToShort(); break; default: throw new ArgumentException(string.Format("GameActive index[{0}] isn't exist.", index)); } #endregion } }
/// <summary> /// 清空多人副本次数 /// </summary> /// <param name="userID"></param> /// <param name="plotID"></param> public static void RemoveDailyMorePlot(string userID, FunctionEnum activeType) { UserDailyRestrain dailyRestrain = new GameDataCacheSet<UserDailyRestrain>().FindKey(userID); if (dailyRestrain != null && dailyRestrain.UserExtend != null) { if (dailyRestrain.UserExtend.MorePlot != null && dailyRestrain.UserExtend.MorePlot.Count > 0) { FunPlot funPlots = dailyRestrain.UserExtend.MorePlot[0]; if (funPlots != null) { DateTime endDate = funPlots.MoreDate.AddHours(1).ToString("yyyy-MM-dd HH:00:00").ToDateTime(); if (endDate < DateTime.Now && DateTime.Now > MorePlotEndDate(userID, activeType)) { dailyRestrain.UserExtend.UpdateNotify(obj => { if (dailyRestrain.UserExtend.MorePlot == null) { dailyRestrain.UserExtend.MorePlot = new CacheList<FunPlot>(); } dailyRestrain.UserExtend.MorePlot.Clear(); return true; }); } } } } }
public AnimationCurveInfo(FunctionEnum functionEnum) { curveType = CurveType.SpecificCurve; this.functionEnum = functionEnum; CreateSpecificCurve(); }
public static FunctionEnum GetRandomFunctionEnumOtherThan(FunctionEnum name) { var choice = (FunctionEnum)Random.Range(1, functions.Length); return(choice == name ? 0 : choice); }
public static Function GetFunction(FunctionEnum name) { return(functions[(int)name]); }
protected override object this[string index] { get { #region switch (index) { case "TaskID": return TaskID; case "TaskType": return TaskType; case "PreTaskID": return PreTaskID; case "CountryID": return CountryID; case "TaskName": return TaskName; case "TaskDescp": return TaskDescp; case "ReleaseNpcID": return ReleaseNpcID; case "ReleaseDialogue": return ReleaseDialogue; case "TakedDialogue": return TakedDialogue; case "DeliveryNpcID": return DeliveryNpcID; case "DeliveryDialogue": return DeliveryDialogue; case "TaskLv": return TaskLv; case "TermsType": return TermsType; case "PlotID": return PlotID; case "PlotNpcID": return PlotNpcID; case "TargetMonsterID": return TargetMonsterID; case "TargetMonsterNum": return TargetMonsterNum; case "TargetItemID": return TargetItemID; case "TargetItemNum": return TargetItemNum; case "FunctionEnum": return FunctionEnum; case "Experience": return Experience; case "GameCoin": return GameCoin; case "EnablePlot": return EnablePlot; case "Version": return Version; case "GeneralID": return GeneralID; case "Reward": return Reward; default: throw new ArgumentException(string.Format("StoryTaskInfo index[{0}] isn't exist.", index)); } #endregion } set { #region switch (index) { case "TaskID": _TaskID = value.ToInt(); break; case "TaskType": _TaskType = value.ToEnum<TaskType>(); break; case "PreTaskID": _PreTaskID = value as int[] ?? new int[0]; break; case "CountryID": _CountryID = value.ToEnum<CountryType>(); break; case "TaskName": _TaskName = value.ToNotNullString(); break; case "TaskDescp": _TaskDescp = value.ToNotNullString(); break; case "ReleaseNpcID": _ReleaseNpcID = value.ToInt(); break; case "ReleaseDialogue": _ReleaseDialogue = ConvertCustomField<CacheList<DialogueInfo>>(value, index); break; case "TakedDialogue": _TakedDialogue = ConvertCustomField<CacheList<DialogueInfo>>(value, index); break; case "DeliveryNpcID": _DeliveryNpcID = value.ToInt(); break; case "DeliveryDialogue": _DeliveryDialogue = ConvertCustomField<CacheList<DialogueInfo>>(value, index); break; case "TaskLv": _TaskLv = value.ToShort(); break; case "TermsType": _TermsType = value.ToEnum<PlotTermsType>(); break; case "PlotID": _PlotID = value.ToInt(); break; case "PlotNpcID": _PlotNpcID = value.ToInt(); break; case "TargetMonsterID": _TargetMonsterID = value.ToNotNullString(); break; case "TargetMonsterNum": _TargetMonsterNum = value.ToNotNullString(); break; case "TargetItemID": _TargetItemID = value.ToInt(); break; case "TargetItemNum": _TargetItemNum = value.ToInt(); break; case "FunctionEnum": _FunctionEnum = value.ToEnum<FunctionEnum>(); break; case "Experience": _Experience = value.ToInt(); break; case "GameCoin": _GameCoin = value.ToInt(); break; case "EnablePlot": _EnablePlot = value.ToNotNullString(); break; case "Version": _Version = value.ToInt(); break; case "GeneralID": _GeneralID = value.ToInt(); break; case "Reward": _Reward = ConvertCustomField<CacheList<PrizeInfo>>(value, index); break; default: throw new ArgumentException(string.Format("StoryTaskInfo index[{0}] isn't exist.", index)); } #endregion } }
/// <summary> /// 开启功能[未完成] /// </summary> /// <param name="user"></param> /// <param name="functionEnum"></param> public static void EnableFunction(GameUser user, FunctionEnum functionEnum) { if (functionEnum <= 0) { return; } var cacheSet = new GameDataCacheSet <UserFunction>(); UserFunction uf = cacheSet.FindKey(user.UserID, functionEnum); if (uf == null) { uf = new UserFunction { UserID = user.UserID, FunEnum = functionEnum, CreateDate = DateTime.Now }; cacheSet.Add(uf); uf = cacheSet.FindKey(user.UserID, functionEnum); } switch (functionEnum) { //case FunctionEnum.Qianghuaqueue: // user.QueueNum = 2; // user.Update(); // break; case FunctionEnum.Qianghua: user.QueueNum = (short)new GameUser().QueueMinNum; //user.Update(); break; case FunctionEnum.Shengmishangdian: UserHelper.RefrshShopsSparData(user, false); break; case FunctionEnum.Mofazheng: InitMagicEmbattle(user.UserID, user.UserLv); break; case FunctionEnum.Zhongzhijiyangshu: GetUserLand(user.UserID); break; case FunctionEnum.Zhongzhijingqianshu: GoinUserQueue(user.UserID); break; case FunctionEnum.Enchant: EnchantHelper.EnchantFunctionOpen(user); break; case FunctionEnum.ReplaceGeneral: GeneralHelper.OpenReplaceGeneral(user); break; default: break; } }
/// <summary> /// Initializes a new instance of the <see cref="Measure" /> class. /// </summary> /// <param name="Id">The id of the measure (required).</param> /// <param name="ResolveTableName">The name of the table to resolve this measure to. I.e. all the counts in this measure will be counts of entities from this table (required).</param> /// <param name="Function">The function to use to aggregate up the data per cell within this measure (required).</param> /// <param name="VariableName">If the measure is based on a variable then the name of the variable to use.</param> /// <param name="Query">If the measure is based on a query - the definition of the query to use.</param> /// <param name="FilterQuery">A query used to filter the records for each cell in this measure.</param> /// <param name="Expression">If the measure is based on an expression then the expression to use.</param> /// <param name="Sort">How the cells are sorted in this measure.</param> public Measure(string Id = default(string), string ResolveTableName = default(string), FunctionEnum Function = default(FunctionEnum), string VariableName = default(string), Query Query = default(Query), Query FilterQuery = default(Query), Expression Expression = default(Expression), SortEnum?Sort = default(SortEnum?)) { // to ensure "Id" is required (not null) if (Id == null) { throw new InvalidDataException("Id is a required property for Measure and cannot be null"); } else { this.Id = Id; } // to ensure "ResolveTableName" is required (not null) if (ResolveTableName == null) { throw new InvalidDataException("ResolveTableName is a required property for Measure and cannot be null"); } else { this.ResolveTableName = ResolveTableName; } // to ensure "Function" is required (not null) if (Function == null) { throw new InvalidDataException("Function is a required property for Measure and cannot be null"); } else { this.Function = Function; } this.VariableName = VariableName; this.Query = Query; this.FilterQuery = FilterQuery; this.Expression = Expression; this.Sort = Sort; }
/// <summary> /// 可创建活动多人副本列表 /// </summary> /// <returns></returns> public MorePlot[] GetMorePlotFestivalList(FunctionEnum functionEnum) { List<MorePlot> morePlotsList = new List<MorePlot>(); var morePlotArray = new List<PlotInfo>(); if (functionEnum == FunctionEnum.MorePlotCoin) { morePlotArray = new ShareCacheStruct<PlotInfo>().FindAll(m => m.PlotType == PlotType.MorePlotCoin); } else if (functionEnum == FunctionEnum.MorePlotEnergy) { morePlotArray = new ShareCacheStruct<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(); }
/// <summary> /// 多人副本结束时间 /// </summary> /// <param name="function"></param> /// <returns></returns> public static DateTime MorePlotEndDate(string userID, FunctionEnum activeType) { DateTime enableTime = new DateTime(); GameActive[] gameActivesArray = new List<GameActive>(new GameActiveCenter(userID).GetActiveList()).FindAll(m => m.ActiveType == activeType).ToArray(); if (gameActivesArray.Length > 0) { GameActive active = gameActivesArray[0]; if (active != null) { enableTime = active.EndTime; } } return enableTime; }
public static FunctionEnum GetNextFunctionEnum(FunctionEnum name) { return(((int)name < functions.Length - 1) ? name + 1 : 0); }
protected override object this[string index] { get { #region switch (index) { case "UserID": return UserID; case "FunEnum": return FunEnum; case "CreateDate": return CreateDate; default: throw new ArgumentException(string.Format("UserFunction index[{0}] isn't exist.", index)); } #endregion } set { #region switch (index) { case "UserID": _UserID = value.ToNotNullString(); break; case "FunEnum": _FunEnum = value.ToEnum<FunctionEnum>(); break; case "CreateDate": _CreateDate = value.ToDateTime(); break; default: throw new ArgumentException(string.Format("UserFunction index[{0}] isn't exist.", index)); } #endregion } }