Beispiel #1
0
      public static void SerializableTable(string[] valuesList, int skey, Dictionary <int, List <object> > _hash)
      {
          if ((int)_ID.MAX_RECORD != valuesList.Length)
          {
              throw TableException.ErrorReader("Load {0} error as CodeSize:{1} not Equal DataSize:{2}", GetInstanceFile(), _ID.MAX_RECORD, valuesList.Length);
          }
          Tab_RoleBaseAttr _values = new Tab_RoleBaseAttr();

          _values.m_Attack             = Convert.ToInt32(valuesList[(int)_ID.ID_ATTACK] as string);
          _values.m_AttackDisType      = Convert.ToInt32(valuesList[(int)_ID.ID_ATTACKDISTYPE] as string);
          _values.m_AttackTime         = Convert.ToInt32(valuesList[(int)_ID.ID_ATTACKTIME] as string);
          _values.m_Camp               = Convert.ToInt32(valuesList[(int)_ID.ID_CAMP] as string);
          _values.m_CharModelID        = Convert.ToInt32(valuesList[(int)_ID.ID_CHARMODELID] as string);
          _values.m_CorpseTime         = Convert.ToInt32(valuesList[(int)_ID.ID_CORPSETIME] as string);
          _values.m_Defense            = Convert.ToInt32(valuesList[(int)_ID.ID_DEFENSE] as string);
          _values.m_DieEffectID        = Convert.ToInt32(valuesList[(int)_ID.ID_DIEEFFECTID] as string);
          _values.m_EnhanceID          = Convert.ToInt32(valuesList[(int)_ID.ID_ENHANCEID] as string);
          _values.m_Exp                = Convert.ToInt32(valuesList[(int)_ID.ID_EXP] as string);
          _values.m_Hit                = Convert.ToInt32(valuesList[(int)_ID.ID_HIT] as string);
          _values.m_IsAttackFly        = Convert.ToInt32(valuesList[(int)_ID.ID_ISATTACKFLY] as string);
          _values.m_Level              = Convert.ToInt32(valuesList[(int)_ID.ID_LEVEL] as string);
          _values.m_MaxHP              = Convert.ToInt32(valuesList[(int)_ID.ID_MAXHP] as string);
          _values.m_MaxXP              = Convert.ToInt32(valuesList[(int)_ID.ID_MAXXP] as string);
          _values.m_MoveSpeed          = Convert.ToInt32(valuesList[(int)_ID.ID_MOVESPEED] as string);
          _values.m_Name               = valuesList[(int)_ID.ID_NAME] as string;
          _values.m_RampType           = Convert.ToInt32(valuesList[(int)_ID.ID_RAMPTYPE] as string);
          _values.m_SelectRadius       = Convert.ToSingle(valuesList[(int)_ID.ID_SELECTRADIUS] as string);
          _values.m_Sex                = Convert.ToInt32(valuesList[(int)_ID.ID_SEX] as string);
          _values.m_SkillstrategyIndex = Convert.ToInt32(valuesList[(int)_ID.ID_SKILLSTRATEGYINDEX] as string);
          _values.m_UnitDataID         = Convert.ToInt32(valuesList[(int)_ID.ID_UNITDATAID] as string);
          _values.m_XpSpeed            = Convert.ToInt32(valuesList[(int)_ID.ID_XPSPEED] as string);
          _values.m_T = Convert.ToInt32(valuesList[(int)_ID.ID_T] as string);

          if (_hash.ContainsKey(skey))
          {
              List <object> tList = _hash[skey];
              tList.Add(_values);
          }
          else
          {
              List <object> tList = new List <object>();
              tList.Add(_values);
              _hash.Add(skey, (List <object>)tList);
          }
      }
        public static bool InitTable_RoleBaseAttr()
        {
            g_RoleBaseAttr.Clear();
            Dictionary <int, List <object> > tmps = new Dictionary <int, List <object> >();

            if (!Tab_RoleBaseAttr.LoadTable(tmps))
            {
                return(false);
            }
            foreach (KeyValuePair <int, List <object> > kv in tmps)
            {
                List <Tab_RoleBaseAttr> values = new List <Tab_RoleBaseAttr>();
                foreach (object subit in kv.Value)
                {
                    values.Add((Tab_RoleBaseAttr)subit);
                }
                g_RoleBaseAttr.Add(kv.Key, values);
            }
            return(true);
        }
Beispiel #3
0
      public static void SerializableTable(string[] valuesList, int skey, Dictionary <int, List <object> > _hash)
      {
          if ((int)_ID.MAX_RECORD != valuesList.Length)
          {
              throw TableException.ErrorReader("Load {0} error as CodeSize:{1} not Equal DataSize:{2}", GetInstanceFile(), _ID.MAX_RECORD, valuesList.Length);
          }
          Tab_RoleBaseAttr _values = new Tab_RoleBaseAttr();

          _values.m_AlertRadius        = Convert.ToSingle(valuesList[(int)_ID.ID_ALERTRADIUS] as string);
          _values.m_AttackDisType      = Convert.ToInt32(valuesList[(int)_ID.ID_ATTACKDISTYPE] as string);
          _values.m_AttackTime         = Convert.ToInt32(valuesList[(int)_ID.ID_ATTACKTIME] as string);
          _values.m_AttackType         = Convert.ToInt32(valuesList[(int)_ID.ID_ATTACKTYPE] as string);
          _values.m_BelongType         = Convert.ToInt32(valuesList[(int)_ID.ID_BELONGTYPE] as string);
          _values.m_BornEffctID        = Convert.ToInt32(valuesList[(int)_ID.ID_BORNEFFCTID] as string);
          _values.m_Camp               = Convert.ToInt32(valuesList[(int)_ID.ID_CAMP] as string);
          _values.m_CharModelID        = Convert.ToInt32(valuesList[(int)_ID.ID_CHARMODELID] as string);
          _values.m_CombatNPC          = Convert.ToInt32(valuesList[(int)_ID.ID_COMBATNPC] as string);
          _values.m_CorpseTime         = Convert.ToInt32(valuesList[(int)_ID.ID_CORPSETIME] as string);
          _values.m_CritiAdd           = Convert.ToInt32(valuesList[(int)_ID.ID_CRITIADD] as string);
          _values.m_CritiMis           = Convert.ToInt32(valuesList[(int)_ID.ID_CRITIMIS] as string);
          _values.m_Critical           = Convert.ToInt32(valuesList[(int)_ID.ID_CRITICAL] as string);
          _values.m_DeCritical         = Convert.ToInt32(valuesList[(int)_ID.ID_DECRITICAL] as string);
          _values.m_DialogID           = Convert.ToInt32(valuesList[(int)_ID.ID_DIALOGID] as string);
          _values.m_DialogRadius       = Convert.ToSingle(valuesList[(int)_ID.ID_DIALOGRADIUS] as string);
          _values.m_DieEffectID        = Convert.ToInt32(valuesList[(int)_ID.ID_DIEEFFECTID] as string);
          _values.m_Dodge              = Convert.ToInt32(valuesList[(int)_ID.ID_DODGE] as string);
          _values.m_DropItemId         = Convert.ToInt32(valuesList[(int)_ID.ID_DROPITEMID] as string);
          _values.m_Ductical           = Convert.ToInt32(valuesList[(int)_ID.ID_DUCTICAL] as string);
          _values.m_EnhanceID          = Convert.ToInt32(valuesList[(int)_ID.ID_ENHANCEID] as string);
          _values.m_Exp                = Convert.ToInt32(valuesList[(int)_ID.ID_EXP] as string);
          _values.m_Hit                = Convert.ToInt32(valuesList[(int)_ID.ID_HIT] as string);
          _values.m_HpCount            = Convert.ToInt32(valuesList[(int)_ID.ID_HPCOUNT] as string);
          _values.m_Id                 = Convert.ToInt32(valuesList[(int)_ID.ID_ID] as string);
          _values.m_IsAttackFly        = Convert.ToInt32(valuesList[(int)_ID.ID_ISATTACKFLY] as string);
          _values.m_IsImmuneJT         = Convert.ToInt32(valuesList[(int)_ID.ID_ISIMMUNEJT] as string);
          _values.m_IsRanbdMove        = Convert.ToInt32(valuesList[(int)_ID.ID_ISRANBDMOVE] as string);
          _values.m_Level              = Convert.ToInt32(valuesList[(int)_ID.ID_LEVEL] as string);
          _values.m_MAttack            = Convert.ToInt32(valuesList[(int)_ID.ID_MATTACK] as string);
          _values.m_MDefense           = Convert.ToInt32(valuesList[(int)_ID.ID_MDEFENSE] as string);
          _values.m_MaxHP              = Convert.ToInt32(valuesList[(int)_ID.ID_MAXHP] as string);
          _values.m_MaxMP              = Convert.ToInt32(valuesList[(int)_ID.ID_MAXMP] as string);
          _values.m_MaxXP              = Convert.ToInt32(valuesList[(int)_ID.ID_MAXXP] as string);
          _values.m_MissionNpcFlag     = Convert.ToInt32(valuesList[(int)_ID.ID_MISSIONNPCFLAG] as string);
          _values.m_MoveSpeed          = Convert.ToInt32(valuesList[(int)_ID.ID_MOVESPEED] as string);
          _values.m_Name               = valuesList[(int)_ID.ID_NAME] as string;
          _values.m_NpcType            = Convert.ToInt32(valuesList[(int)_ID.ID_NPCTYPE] as string);
          _values.m_PAttack            = Convert.ToInt32(valuesList[(int)_ID.ID_PATTACK] as string);
          _values.m_PDefense           = Convert.ToInt32(valuesList[(int)_ID.ID_PDEFENSE] as string);
          _values.m_PathRadius         = Convert.ToSingle(valuesList[(int)_ID.ID_PATHRADIUS] as string);
          _values.m_RampType           = Convert.ToInt32(valuesList[(int)_ID.ID_RAMPTYPE] as string);
          _values.m_RandMoveDis        = Convert.ToSingle(valuesList[(int)_ID.ID_RANDMOVEDIS] as string);
          _values.m_ReviveTime         = Convert.ToInt32(valuesList[(int)_ID.ID_REVIVETIME] as string);
          _values.m_Sex                = Convert.ToInt32(valuesList[(int)_ID.ID_SEX] as string);
          _values.m_ShowBornEffect     = Convert.ToInt32(valuesList[(int)_ID.ID_SHOWBORNEFFECT] as string);
          _values.m_SkillstrategyIndex = Convert.ToInt32(valuesList[(int)_ID.ID_SKILLSTRATEGYINDEX] as string);
          _values.m_Strike             = Convert.ToInt32(valuesList[(int)_ID.ID_STRIKE] as string);

          if (_hash.ContainsKey(skey))
          {
              List <object> tList = _hash[skey];
              tList.Add(_values);
          }
          else
          {
              List <object> tList = new List <object>();
              tList.Add(_values);
              _hash.Add(skey, (List <object>)tList);
          }
      }