public string FindString(INFO_FORMAT_LABEL label, SystemLanguage?lang = null) { if (label == INFO_FORMAT_LABEL.BLANK_LINE) { return(""); } var _rows = this.DefaultCachedList.Where(_row => { // field FieldInfo fieldInfo = _row.GetType().GetField(ColumnLabelName, BindingFlags.Instance | BindingFlags.Public); if (fieldInfo == null) { return(false); } return((INFO_FORMAT_LABEL)fieldInfo.GetValue(_row) == label); }).ToList(); if (_rows.Count == 0) { throw new System.NullReferenceException(); } if (_rows.Count > 1) { throw new System.Exception("Find Unique but got duplicated!"); } SystemLanguage _lang = lang ?? ConfigDataManager.Instance.UserLanguage; return(GetString(_rows[0], _lang)); }
public ushort FindID(INFO_FORMAT_LABEL label, SystemLanguage?lang = null) { var _rows = this.DefaultCachedList.Where(_row => { // field FieldInfo fieldInfo = _row.GetType().GetField(ColumnLabelName, BindingFlags.Instance | BindingFlags.Public); if (fieldInfo == null) { return(false); } return((INFO_FORMAT_LABEL)fieldInfo.GetValue(_row) == label); }).ToList(); if (_rows.Count == 0) { throw new System.NullReferenceException(); } if (_rows.Count > 1) { throw new System.Exception("Find Unique but got duplicated!"); } return(_rows[0].ID); }
public void EnqueueMessage(INFO_FORMAT_LABEL formatLabel) { IMultiLangString <AbsMultiLanguageTable> _strFormat = null; var _id = BattleStringFormatTableReader.Instance.FindID(formatLabel); _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance); if (_strFormat != null) { this.StringQueue.Enqueue(_strFormat); } }
public void EnqueueMessage(INFO_FORMAT_LABEL formatLabel, FightDataFormat attackerData, FightDataFormat defenderData = null, params object[] args) { IMultiLangString <AbsMultiLanguageTable> _strFormat = null; var _id = BattleStringFormatTableReader.Instance.FindID(formatLabel); switch (formatLabel) { case INFO_FORMAT_LABEL.ACTIVE_ATTACK: { var _nameString = GenerateCharacterName(attackerData); _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, _nameString); break; } case INFO_FORMAT_LABEL.AVOID_ATTACK: { var _nameString = GenerateCharacterName(defenderData); _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, _nameString); break; } case INFO_FORMAT_LABEL.GET_DAMAGE: { var _defenderNameString = GenerateCharacterName(defenderData); var _defenderDamageString = GenerateDamage(attackerData, defenderData); _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, _defenderNameString, _defenderDamageString); break; } case INFO_FORMAT_LABEL.IS_DEAD: { var _defenderNameString = GenerateCharacterName(defenderData); _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, _defenderNameString); break; } case INFO_FORMAT_LABEL.GOT_EXP: { //var _nameString = GenerateCharacterName (heroAttributes); _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, //_nameString, args); break; } case INFO_FORMAT_LABEL.LEVEL_UP: { var _nameString = GenerateCharacterName(attackerData); var _level = args [0]; _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, _nameString, _level); break; } case INFO_FORMAT_LABEL.GOT_AURA: { _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, args); break; } case INFO_FORMAT_LABEL.GOT_DIMENSION_CHIP: { _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, args); break; } case INFO_FORMAT_LABEL.ACTIVE_SKILL: { var _nameString = GenerateCharacterName(attackerData); var _skill = args [0] as ICommonSkill; _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, _nameString, _skill.NameString); break; } case INFO_FORMAT_LABEL.SKILL_DOT_BURN_ATTACH: { var _nameString = GenerateCharacterName(defenderData); var _power = args [0]; _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, _nameString, _power); break; } case INFO_FORMAT_LABEL.SKILL_DOT_BURN_DAMAGE: { var _nameString = GenerateCharacterName(attackerData); var _damage = args [0]; _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, _nameString, _damage); break; } case INFO_FORMAT_LABEL.SKILL_MUST_FAILED: { _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance); break; } case INFO_FORMAT_LABEL.DEFENDER_AC_DOWN: { var _nameString = GenerateCharacterName(defenderData); var _AC = args [0]; _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, _nameString, _AC); break; } case INFO_FORMAT_LABEL.DEFENDER_ATK_DOWN_DEF_DOWN: { var _nameString = GenerateCharacterName(defenderData); var _ATK = args [0]; var _DEF = args [1]; _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, _nameString, _ATK, _DEF); break; } case INFO_FORMAT_LABEL.DEFENDER_HIT_DOWN_AVD_DOWN: { var _nameString = GenerateCharacterName(defenderData); var _HIT = args [0]; var _AVD = args [1]; _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, _nameString, _HIT, _AVD); break; } case INFO_FORMAT_LABEL.DEFENDER_HIT_DOWN_AVD_DOWN_CRI_DOWN: { var _nameString = GenerateCharacterName(defenderData); var _HIT = args [0]; var _AVD = args [1]; var _CRI = args [1]; _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, _nameString, _HIT, _AVD, _CRI); break; } case INFO_FORMAT_LABEL.HP_UP: { IMultiLangString <AbsMultiLanguageTable> _nameString = null; if (attackerData != null) { _nameString = GenerateCharacterName(attackerData); } else if (defenderData != null) { _nameString = GenerateCharacterName(defenderData); } var _HP = args [0]; _strFormat = new MultiLangString <BattleStringFormatTable> ( _id, BattleStringFormatTableReader.Instance, _nameString, _HP); break; } default: break; } if (_strFormat != null) { _strFormat.DisattachLangUpdate(); this.StringQueue.Enqueue(_strFormat); } }