public ConstInfo DeclareConst(ConstInfo ci) { //TODO:ConstOffset.ValueType== Qs.Enumerators.ValueType.Reg_Imm; //TODO:ConstOffset.AsMemory=true; var length = ci.Value.Length; foreach (var @cons in Consts) { var @const = @cons.Key; var Def = false; if (@const == ci) { return(ci); } if (@const.Value.Length == length) { for (var i = length - 1; i >= 0 && !Def; i--) { if (ci.Value[i] != @const.Value[i]) { Def = true; } } } if (!Def) { return(ci); } } Consts.Add(ci, new List <int>()); ci.Handle = ConstOffset; ConstOffset += ci.SizeOf(); stream.push(ci.Value); return(ci); }
private List <LineStation> TableToList(DataTable dt) { List <LineStation> result = new List <LineStation>(); if (dt == null || dt.Rows.Count == 0) { return(result); } LineStation model; foreach (DataRow dr in dt.Rows) { model = new LineStation { UDID = Convert.ToInt32(dr["线路上下行id"]), stationIndex = Convert.ToInt32(dr["顺序"]), stationId = Convert.ToInt32(dr["站点id"]), stationName = ConstInfo.filterStr(dr["名称"].ToString()), gpsX = dr["gpsx2"].ToString(), gpsY = dr["gpsy2"].ToString(), isVirtual = Convert.ToInt32(dr["realStation"]) }; result.Add(model); } return(result); }
/// <summary> /// Prepare all messages list /// </summary> private void PrepareAllMessageList() { AllMessageModels = new Dictionary <string, MSGModel>(); List <MSGModel> MsgsList = new List <MSGModel>(); Thread oThread = new Thread(delegate() { try { bool isConnectedDB = ConstInfo.GetAllValidMessages(ref MsgsList); foreach (MSGModel m in MsgsList) { AllMessageModels[m.NodeAddress + "-" + m.Command] = m; } if (!isConnectedDB) { this.Invoke((ThreadStart) delegate() { MessageBoxEX.Show(this, "Failed to get all messages definition.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }); } } catch {} this.GetAllMessages = false; }); oThread.Start(); }
protected IEnumerable <string> buildEnumConstants(ConstInfo constInfo, IEnumerable <string> names) { yield return("public enum " + constInfo.ClassName); yield return("{"); yield return(String.Join("," + Environment.NewLine, names)); yield return("}"); }
protected IEnumerable <string> buildConstants(ConstInfo constInfo, IEnumerable <string> names) { if (constInfo.Mode == ConstMode.Enum) { return(buildEnumConstants(constInfo, names)); } else { return(buildIntConstants(constInfo, names)); } }
protected IEnumerable <string> buildIntConstants(ConstInfo constInfo, IEnumerable <string> names) { yield return("public abstract class " + constInfo.ClassName); yield return("{"); foreach (Tuple <string, int> pair in names.ZipWithIndex()) { yield return("public const int " + pair.Item1 + " = " + pair.Item2 + ";"); } yield return("}"); }
public void ReplaceMembersInContent(BaseTree baseTree) { Expression newContent = baseTree.GetCompiledConstValue(_originalContent); _compiledContent.ClearChildren(); _compiledContent.AddChildren(newContent.GetChildren()); //this._constInfo.Value = _content; ConstInfo is for original SF...if this is overwrite, we need to find copied ConstInfo ConstInfo rightConst = baseTree.SF.SI.FindLocalConst(this._constInfo.Name); rightConst.Value = _compiledContent; }
public static void InitConstData() { ConstInfo areaConstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_ENERGY_MAXCOUNT); ConstInfo sugarConstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_SUGAR_RADIO); ConstInfo freshConstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_ITEM_COUNT); ItemAreaCount = int.Parse(areaConstInfo.data) / (int)AppConst.factor; ItemFreshCount = int.Parse(freshConstInfo.data) / (int)AppConst.factor; ItemSugarDistance = float.Parse(sugarConstInfo.data) / AppConst.factor; }
public ConstInfo GetConstAt(ConstInfo ci, int ip) { List <int> lst; if (!Consts.TryGetValue(ci, out lst)) { load.LogIn(load.ByteCodeMapper.CurrentScop.Current, null, this, ci.Name + " Constant Not Implemented In Constant Garbage"); } lst.Add(ip); return(ci); }
/// <summary> /// operation fo battery time synchronization /// </summary> /// <param name="isSetTime"></param> /// <returns></returns> public byte[] BatteryTimeOperation(bool isSetTime) { //send date time TimeSpan span = DateTime.Now - ConstInfo.GetBaseTime(); uint seconds = Convert.ToUInt32(span.TotalSeconds); byte[] timeByte = BitConverter.GetBytes(seconds); TPCANMsg time = CanbusManager.createMsg(NodeIdentityEnum.node_battery, ConstInfo.Command_batery_dateTime, ConstInfo.SurfaceCanBusAddr, timeByte, 0); if (isSetTime) { time.DATA[2] = 0; //set time } else { time.DATA[2] = 1;// get battery time } sendPCANData(ref time); int dataLen = 0; byte[] datas = this.getCanBusResponData(ConstInfo.SurfaceCanBusAddr, (int)NodeIdentityEnum.node_battery, ConstInfo.Command_batery_dateTime, 2, ref dataLen); if (dataLen != 8 || datas[2] != time.DATA[2]) { return(null); } if (isSetTime) { uint ses = BitConverter.ToUInt32(datas, 4); if (ses != seconds) { return(null); } return(datas); } else { return(datas); } }
public byte[] BatteryPoweroNControl( ) { TPCANStatus stsResult; TPCANMsg pownOn = CanbusManager.createMsg((int)NodeIdentityEnum.node_battery, ConstInfo.Command_battery_power, ConstInfo.SurfaceCanBusAddr, null, 0); pownOn.LEN = 3; pownOn.DATA[2] = 1; //pownOn.DATA[ 2 ] = 0;//OFF ConstInfo.SaveLogToFile("POWER COMMAND TO BATTERY-- on"); stsResult = sendPCANData(ref pownOn); int dl = 0; byte[] res = this.getCanBusResponData(ConstInfo.SurfaceCanBusAddr, (int)NodeIdentityEnum.node_battery, ConstInfo.Command_battery_power, this.PowerProcessTime, ref dl); if (dl <= 0) { return(null); } byte[] result = new byte[dl]; for (int i = 0; i < res.Length && i < dl; i++) { result[i] = res[i]; } return(result); }
public void InitEntityAttribute(HeroInfo info) { ConstInfo speedConstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_SPEED); Attribute.BaseSpeed = float.Parse(speedConstInfo.data) / AppConst.factor; Attribute.Speed = Attribute.BaseSpeed; ConstInfo rebornconstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_REBORN); Attribute.RebornTime = uint.Parse(rebornconstInfo.data) / AppConst.factor; ConstInfo atkDisconstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_ATK_RADIO); Attribute.Atkdis = uint.Parse(atkDisconstInfo.data) / AppConst.factor; ConstInfo maxPhyconstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_MAX_PHY); Attribute.MaxPhy = uint.Parse(maxPhyconstInfo.data) / AppConst.factor; Attribute.CurPhy = Attribute.MaxPhy; ConstInfo perPhyconstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_COST_PHY_SPEED); Attribute.CostPhySpeed = uint.Parse(perPhyconstInfo.data) / AppConst.factor; OccupationInfo occpInfo = InfoMgr <OccupationInfo> .Instance.GetInfo(info.occupationId); Attribute.Skills = occpInfo.skillId; }
public override void CheckSemantic(MoveInfo treeInfo, ScriptInfo scriptInfo, CheckingInfo checkingInfo) { IElement baseVar = this.GetChildren()[0]; string baseVarName = baseVar.ToString(); foreach (string tStr in ScriptManager.GlobalVariables) { if (baseVarName.EqualCode(tStr)) { return; } } if (checkingInfo.CurrentFunc != null) // inside func { LocalVarInfo tryVarInfo = checkingInfo.CurrentFunc.LocalVars.Find(a => a.Name.EqualCode(baseVarName)); if (tryVarInfo != null && this.CharIndex >= tryVarInfo.StartIndex) { // check "var = var;" | "var[5] = var[5] + 10"; | etc. if (tryVarInfo.VarNameDef == null) // it is reference { tryVarInfo.RefCount++; return; } else if (tryVarInfo.VarNameDef == this) // it is definition { return; } else if (tryVarInfo.AssignDef == null) // it is reference { tryVarInfo.RefCount++; return; } else if (!treeInfo.IsInBlock(tryVarInfo.AssignDef)) // it is reference { tryVarInfo.RefCount++; return; } } } ConstInfo constInfo = scriptInfo.FindLocalConst(baseVarName); if (constInfo == null) { constInfo = scriptInfo.FindIncludesConst(baseVarName); if (constInfo == null) { constInfo = scriptInfo.FindGlobalsConst(baseVarName); if (constInfo == null) { scriptInfo.SF.Errors.Add( new SemanticError("Unknown variable/constant '" + baseVarName + "'", treeInfo.GetErrorInfo(treeInfo.Current))); return; } } if (constInfo.Access == MemberAccess.Private) { scriptInfo.SF.Errors.Add( new SemanticError("Cannot access member '" + baseVarName + "'", treeInfo.GetErrorInfo(treeInfo.Current))); } } ToConstant(treeInfo, constInfo); scriptInfo.References.Add(new ConstRefInfo(scriptInfo.SF, constInfo, this.CharIndex, this.CharLength, checkingInfo.SC.SourceCode.Substring(this.CharIndex, this.CharLength))); }
public AssemblyTreeMember(IMemberInfo member) : this() { memberInfo = member; Name = member.Name; Text = Name; #region ToolTipText if (member is FuncInfo) { ToolTipText = FileManager.GetCallTipText((FuncInfo)member, ((FuncInfo)member).Parameters.Count); } else if (member is ConstInfo) { ToolTipText = FileManager.GetCallTipText((ConstInfo)member); } else if (member is UsingInfo) { ToolTipText = FileManager.GetCallTipText((UsingInfo)member); } else { ToolTipText = Name; } #endregion #region Image if (member is ConstInfo) { ConstInfo c = (ConstInfo)member; if (c.Sealed) { ImageIndex = AssemblyTreeIcons.ConstantSealed; } else if (c.Access == MemberAccess.Private) { ImageIndex = AssemblyTreeIcons.ConstantPrivate; } else if (c.Access == MemberAccess.Public) { ImageIndex = AssemblyTreeIcons.ConstantPublic; } else { throw new ArgumentException("Unknown icon"); } } else if (member is FuncInfo) { FuncInfo f = (FuncInfo)member; if (f.Access == MemberAccess.Private) { ImageIndex = AssemblyTreeIcons.FunctionPrivate; } else if (f.Access == MemberAccess.Public) { ImageIndex = AssemblyTreeIcons.FunctionPublic; } else { throw new ArgumentException("Unknown icon"); } } else if (member is UsingInfo) { UsingInfo u = (UsingInfo)member; if (u.Access == MemberAccess.Private) { ImageIndex = AssemblyTreeIcons.UsingPrivate; } else if (u.Access == MemberAccess.Public) { ImageIndex = AssemblyTreeIcons.UsingPublic; } else { throw new ArgumentException("Unknown icon"); } } else { throw new ArgumentException("member"); } SelectedImageIndex = ImageIndex; #endregion this.ContextMenuStrip = new MemberContextMenuStrip(this, member); }
/// <summary> /// Power on time out thread. /// </summary> private void PowerOnTiemout() { if (!ConstInfo.IsSoftwarePowerON) { return; } Dictionary <int, string> statusMap = new Dictionary <int, string>(); string batteryTelemetryKey = "95-51"; Dictionary <string, MSGModel> dic = ConstInfo.GetMessagesMap(); if (dic.ContainsKey(batteryTelemetryKey)) { Dictionary <int, string> sm = dic[batteryTelemetryKey].FormatMap; if (sm != null && sm.Count > 0) { foreach (int key in sm.Keys) { statusMap.Add(key, sm[key]); } } } if (statusMap.Count <= 0) { statusMap.Add(1, "OFF-Start Up"); statusMap.Add(2, "ON-Pressure"); statusMap.Add(3, "ON-Temperature"); statusMap.Add(4, "ON-Software Control"); statusMap.Add(5, "ON-Safety_OFF"); statusMap.Add(6, "OFF-Safety_ON"); statusMap.Add(7, "OFF-Low Voltage"); } while (!this.isDisposed) { if (this._isSoftwarePowerRunning && this.manager != null) { int resLen = 0; byte[] data = null; this.sendPCANData(ref this.CANBusPowerOnMSG); if (this._isSoftwarePowerControlResponseEnable && this.SoftwarePowerControlEvent != null) { data = this.getCanBusResponData(ConstInfo.SurfaceCanBusAddr, (int)NodeIdentityEnum.node_battery, ConstInfo.Command_battery_power, 0.25, ref resLen); int telemetryStatus = -1; if (resLen >= 5) { telemetryStatus = data[4]; } int ONFFStatus = -1; if (resLen >= 4) { ONFFStatus = data[3]; } string telemetryStatusStr = ""; if (statusMap.ContainsKey(telemetryStatus)) { telemetryStatusStr = statusMap[telemetryStatus]; } else { string ONFFStatusStr = ""; switch (ONFFStatus) { case -1: ONFFStatusStr = ""; break; case 1: ONFFStatusStr = "Going to OFF"; break; case 2: ONFFStatusStr = "Power ON"; break; case 3: ONFFStatusStr = "Power OFF"; break; default: ONFFStatusStr = ""; break; } telemetryStatusStr = ONFFStatusStr; } this.SoftwarePowerControlEvent(telemetryStatusStr); } } for (int i = 0; i < 10; i++) { if (this.isDisposed) { return; } Thread.Sleep(1000); } } }
private static void Parse(MoveInfo parentInfo, ParsingInfo parsingInfo, ScriptInfo scriptInfo) { ConstDef constDef = new ConstDef(parentInfo.Current.CharIndex, parentInfo.Current.CharLength, parentInfo.Current.LineIndex); MemberAccess access = MemberAccess.Public; bool isSealed = false; int startIndex = parentInfo.CurrentIndex; MoveInfo moveInfo = new MoveInfo(parentInfo); // sealed modifier SealedModifier trySealed = SealedModifier.GetModifier(moveInfo); if (trySealed != null) { startIndex = moveInfo.CurrentIndex; isSealed = true; } else { moveInfo = new MoveInfo(parentInfo); } // visibility modifier AccessModifier tryAccess = AccessModifier.GetModifier(moveInfo, out access); if (tryAccess != null) { startIndex = moveInfo.CurrentIndex; } else { moveInfo = new MoveInfo(parentInfo); } // xml XMLBlock xml = XMLBlock.GetXMLSummary(moveInfo); constDef.xmlBlock = xml; if (xml != null) { startIndex = moveInfo.CurrentIndex; } // assign moveInfo = new MoveInfo(parentInfo); IElement nameElem = moveInfo.Current; moveInfo.FindNextBlack(SearchDirection.LeftToRight); // = moveInfo.FindNextBlack(SearchDirection.LeftToRight); // behind = // expression Expression exp = Expression.Parse(moveInfo, parsingInfo, scriptInfo); if (exp == null) { throw new SyntaxException("Could not parse constDef expression", parentInfo.GetErrorInfo()); } constDef._compiledContent = exp; // terminal IElement terminalTry = moveInfo.FindNextBlack(SearchDirection.LeftToRight); if (terminalTry == null || !(terminalTry.IsTT(TokenType.SemiColon))) { throw new SyntaxException("Missing directive ';'?", parentInfo.GetErrorInfo()); } int length = (moveInfo.CurrentIndex + 1) - startIndex; constDef.AddChildren(parentInfo.CurrentElements.GetRange(startIndex, length)); parentInfo.MoveToIndex(startIndex); parentInfo.Replace(length, constDef); // info string name = nameElem.ToString(); // add const def to list parsingInfo.ConstDefList.Add(constDef); /*if (scriptInfo.Constants.FindIndex(a => a.Name == name) != -1) * ErrorManager.Semantic("Constant '" + name + "' already defined", new ErrorInfo(parentInfo.ErrorInfo)); * else * {*/ ConstInfo constInfo = GetInfo(name, access, exp, isSealed, constDef.xmlBlock, parsingInfo, constDef); scriptInfo.AddConstant(constInfo); constDef._constInfo = constInfo; //} }
private void ToConstant(MoveInfo treeInfo, ConstInfo constant) { ConstName constName = new ConstName(this.GetChildren(), constant); treeInfo.Replace(1, constName); }
public static void InitConstData() { ConstInfo areaConstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_ENERGY_MAXCOUNT); ConstInfo sugarConstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_SUGAR_RADIO); ConstInfo freshConstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_ITEM_COUNT); ItemAreaCount = int.Parse(areaConstInfo.data) / (int)AppConst.factor; ItemFreshCount = int.Parse(freshConstInfo.data) / (int)AppConst.factor; ItemSugarDistance = float.Parse(sugarConstInfo.data) / AppConst.factor; ConstInfo speedConstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_SPEED); BaseSpeed = float.Parse(speedConstInfo.data) / AppConst.factor; ConstInfo rebornconstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_REBORN); RebornTime = int.Parse(rebornconstInfo.data) / AppConst.factor; ConstInfo atkDisconstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_ATK_RADIO); Basedis = float.Parse(atkDisconstInfo.data) / AppConst.factor; ConstInfo maxPhyconstInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_MAX_PHY); MaxPhy = int.Parse(maxPhyconstInfo.data) / AppConst.factor; ConstInfo perSpeedInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_COST_PHY_SPEED); CostPhySpeed = int.Parse(perSpeedInfo.data) / AppConst.factor; ConstInfo maxHpInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_MAX_HP); MaxHp = int.Parse(maxHpInfo.data) / AppConst.factor; ConstInfo atkAngleInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_ATK_ANGLE); AtkAngle = int.Parse(atkAngleInfo.data) / AppConst.factor; ConstInfo Flee = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_FLEE_DIS); FleeDis = float.Parse(Flee.data) / AppConst.factor; ConstInfo Chase = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_CHASE_DIS); ChaseDis = float.Parse(Chase.data) / AppConst.factor; ConstInfo AcctInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_ACC_INTERVAL); AcctInterval = float.Parse(AcctInfo.data) / AppConst.factor; ConstInfo SkillInter = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_SKILL_INTERVAL); SkillInterval = float.Parse(SkillInter.data) / AppConst.factor; ConstInfo FleeInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_FLEE_INTERVAL); FleeInterval = float.Parse(FleeInfo.data) / AppConst.factor; ConstInfo KillInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_KILL_INTERVAL); KillInterval = float.Parse(KillInfo.data) / AppConst.factor; ConstInfo AcctMinInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_ACC_MINTIME); AcctMinTime = float.Parse(AcctMinInfo.data) / AppConst.factor; ConstInfo AcctMaxInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_ACC_MAXTIME); AcctMaxTime = float.Parse(AcctMaxInfo.data) / AppConst.factor; ConstInfo SkillMinTimeInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_SKILL_MINTIME); SkillMinTime = float.Parse(SkillMinTimeInfo.data) / AppConst.factor; ConstInfo SkillMaxTimeInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_SKILL_MAXTIME); SkillMaxTime = float.Parse(SkillMaxTimeInfo.data) / AppConst.factor; ConstInfo ChaseTimeInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_CHASE_TIME); ChaseTime = float.Parse(ChaseTimeInfo.data) / AppConst.factor; ConstInfo AcceSpeedInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_ACCT_SPEED); AIAcceSpeed = float.Parse(AcceSpeedInfo.data) / AppConst.factor; ConstInfo AISkillSpeedInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_INSTANT_SPEED); AISkillSpeed = float.Parse(AISkillSpeedInfo.data) / AppConst.factor; ConstInfo MinCountInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_AI_MINCOUNT); MinCount = int.Parse(MinCountInfo.data) / AppConst.factor; ConstInfo MaxCountInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_AI_MAXCOUNT); MaxCount = int.Parse(MaxCountInfo.data) / AppConst.factor; ConstInfo ChaseLevInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_CHASE_LEV); ChaseLev = int.Parse(ChaseLevInfo.data) / AppConst.factor; ConstInfo AIDetectIntervalInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_AI_DETECT_RANGE_INTERVAL); AIDetectInterval = int.Parse(AIDetectIntervalInfo.data) / AppConst.factor; ConstInfo AIRandomDirIntervalInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_AI_RANDOM_DIR_INTERVAL); AIRandomDirInterval = int.Parse(AIRandomDirIntervalInfo.data) / AppConst.factor; ConstInfo AIRandomItemRadioInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_AI_RANDOM_ITEM_RADIO); AIRandomItemRadio = float.Parse(AIRandomItemRadioInfo.data) / AppConst.factor; ConstInfo PhyRecoverSpeednfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_PHY_RECOVER_SPEED); PhyRecoverSpeed = float.Parse(PhyRecoverSpeednfo.data) / AppConst.factor; ConstInfo CrashSpeedInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_CRASH_SPEED); CrashSpeed = float.Parse(CrashSpeedInfo.data) / AppConst.factor; ConstInfo CrashTimeInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_CRASH_TIME); CrashTime = float.Parse(CrashTimeInfo.data) / AppConst.factor; ConstInfo FreshIntervalInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_FRESH_INTERVAL); FreshInterval = float.Parse(FreshIntervalInfo.data) / AppConst.factor; ConstInfo ReliveScoreParam1Info = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_RELIVE_PARAM1); ReliveScoreParam1 = float.Parse(ReliveScoreParam1Info.data) / AppConst.factor; ConstInfo ReliveScoreParam2Info = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_RELIVE_PARAM2); ReliveScoreParam2 = float.Parse(ReliveScoreParam2Info.data) / AppConst.factor; ConstInfo ReliveRandomParam1Info = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_RELIVE_RADOM_PARAM1); ReliveRandomParam1 = float.Parse(ReliveRandomParam1Info.data) / AppConst.factor; ConstInfo ReliveRandomParam2Info = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_RELIVE_RADOM_PARAM2); ReliveRandomParam2 = float.Parse(ReliveRandomParam2Info.data) / AppConst.factor; ConstInfo DropItemRangeParam1Info = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_ITEM_DROP_PARAM1); DropItemRangeParam1 = float.Parse(DropItemRangeParam1Info.data) / AppConst.factor; ConstInfo DropItemRangeParam2Info = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_ITEM_DROP_PARAM2); DropItemRangeParam2 = float.Parse(DropItemRangeParam2Info.data) / AppConst.factor; ConstInfo TimerTotalInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_TIME_TOTAL); TimerTotal = float.Parse(TimerTotalInfo.data); ConstInfo NameLenthInfo = InfoMgr <ConstInfo> .Instance.GetInfo((int)ConstType.CONST_NAME_LENTH); NameLenth = int.Parse(NameLenthInfo.data); }
public ConstName(List <IElement> elems, ConstInfo constInfo) : base(elems) { this._constInfo = constInfo; }