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_SceneClass _values = new Tab_SceneClass();

          _values.m_BGMusic           = Convert.ToInt32(valuesList[(int)_ID.ID_BGMUSIC] as string);
          _values.m_CopySceneID       = Convert.ToInt32(valuesList[(int)_ID.ID_COPYSCENEID] as string);
          _values.m_DeadPunishRule    = Convert.ToInt32(valuesList[(int)_ID.ID_DEADPUNISHRULE] as string);
          _values.m_DistortionTexture = valuesList[(int)_ID.ID_DISTORTIONTEXTURE] as string;
          _values.m_EntryX            = Convert.ToSingle(valuesList[(int)_ID.ID_ENTRY_X] as string);
          _values.m_EntryZ            = Convert.ToSingle(valuesList[(int)_ID.ID_ENTRY_Z] as string);
          _values.m_IsCanCallTeam     = Convert.ToInt32(valuesList[(int)_ID.ID_ISCANCALLTEAM] as string);
          _values.m_IsCanRide         = Convert.ToInt32(valuesList[(int)_ID.ID_ISCANRIDE] as string);
          _values.m_IsCanTeamFollow   = Convert.ToInt32(valuesList[(int)_ID.ID_ISCANTEAMFOLLOW] as string);
          _values.m_IsCanUseLight     = Convert.ToInt32(valuesList[(int)_ID.ID_ISCANUSELIGHT] as string);
          _values.m_IsCanUseXp        = Convert.ToInt32(valuesList[(int)_ID.ID_ISCANUSEXP] as string);
          _values.m_Length            = Convert.ToInt32(valuesList[(int)_ID.ID_LENGTH] as string);
          _values.m_Name                   = valuesList[(int)_ID.ID_NAME] as string;
          _values.m_Obstacle               = valuesList[(int)_ID.ID_OBSTACLE] as string;
          _values.m_PVPRule                = Convert.ToInt32(valuesList[(int)_ID.ID_PVPRULE] as string);
          _values.m_PlayerViewRadius       = Convert.ToSingle(valuesList[(int)_ID.ID_PLAYERVIEWRADIUS] as string);
          _values.m_PlayersMaxA            = Convert.ToInt32(valuesList[(int)_ID.ID_PLAYERSMAXA] as string);
          _values.m_PlayersMaxB            = Convert.ToInt32(valuesList[(int)_ID.ID_PLAYERSMAXB] as string);
          _values.m_ReliveType [0]         = Convert.ToInt32(valuesList[(int)_ID.ID_RELIVETYPE_1] as string);
          _values.m_ReliveType [1]         = Convert.ToInt32(valuesList[(int)_ID.ID_RELIVETYPE_2] as string);
          _values.m_ReliveType [2]         = Convert.ToInt32(valuesList[(int)_ID.ID_RELIVETYPE_3] as string);
          _values.m_ResName                = valuesList[(int)_ID.ID_RESNAME] as string;
          _values.m_SafeX                  = Convert.ToSingle(valuesList[(int)_ID.ID_SAFE_X] as string);
          _values.m_SafeZ                  = Convert.ToSingle(valuesList[(int)_ID.ID_SAFE_Z] as string);
          _values.m_SceneID                = Convert.ToInt32(valuesList[(int)_ID.ID_SCENEID] as string);
          _values.m_SceneMapHeight         = Convert.ToInt32(valuesList[(int)_ID.ID_SCENEMAPHEIGHT] as string);
          _values.m_SceneMapLogicWidth     = Convert.ToInt32(valuesList[(int)_ID.ID_SCENEMAPLOGICWIDTH] as string);
          _values.m_SceneMapTexture        = valuesList[(int)_ID.ID_SCENEMAPTEXTURE] as string;
          _values.m_SceneMapWidth          = Convert.ToInt32(valuesList[(int)_ID.ID_SCENEMAPWIDTH] as string);
          _values.m_TerrainHeightMapLength = Convert.ToInt32(valuesList[(int)_ID.ID_TERRAINHEIGHTMAPLENGTH] as string);
          _values.m_TerrainHeightMapWidth  = Convert.ToInt32(valuesList[(int)_ID.ID_TERRAINHEIGHTMAPWIDTH] as string);
          _values.m_TerrainHeightMax       = Convert.ToInt32(valuesList[(int)_ID.ID_TERRAINHEIGHTMAX] as string);
          _values.m_Type                   = Convert.ToInt32(valuesList[(int)_ID.ID_TYPE] as string);
          _values.m_Width                  = Convert.ToInt32(valuesList[(int)_ID.ID_WIDTH] 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_SceneClass()
        {
            g_SceneClass.Clear();
            Dictionary <int, List <object> > tmps = new Dictionary <int, List <object> >();

            if (!Tab_SceneClass.LoadTable(tmps))
            {
                return(false);
            }
            foreach (KeyValuePair <int, List <object> > kv in tmps)
            {
                List <Tab_SceneClass> values = new List <Tab_SceneClass>();
                foreach (object subit in kv.Value)
                {
                    values.Add((Tab_SceneClass)subit);
                }
                g_SceneClass.Add(kv.Key, values);
            }
            return(true);
        }
Example #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_SceneClass _values = new Tab_SceneClass();

          _values.m_AttackPosX [0]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSX1] as string);
          _values.m_AttackPosX [1]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSX2] as string);
          _values.m_AttackPosX [2]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSX3] as string);
          _values.m_AttackPosX [3]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSX4] as string);
          _values.m_AttackPosX [4]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSX5] as string);
          _values.m_AttackPosX [5]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSX6] as string);
          _values.m_AttackPosX [6]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSX7] as string);
          _values.m_AttackPosX [7]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSX8] as string);
          _values.m_AttackPosX [8]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSX9] as string);
          _values.m_AttackPosX [9]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSX10] as string);
          _values.m_AttackPosX [10]    = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSX11] as string);
          _values.m_AttackPosZ [0]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSZ1] as string);
          _values.m_AttackPosZ [1]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSZ2] as string);
          _values.m_AttackPosZ [2]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSZ3] as string);
          _values.m_AttackPosZ [3]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSZ4] as string);
          _values.m_AttackPosZ [4]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSZ5] as string);
          _values.m_AttackPosZ [5]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSZ6] as string);
          _values.m_AttackPosZ [6]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSZ7] as string);
          _values.m_AttackPosZ [7]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSZ8] as string);
          _values.m_AttackPosZ [8]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSZ9] as string);
          _values.m_AttackPosZ [9]     = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSZ10] as string);
          _values.m_AttackPosZ [10]    = Convert.ToSingle(valuesList[(int)_ID.ID_ATTACKPOSZ11] as string);
          _values.m_BGMusic            = Convert.ToInt32(valuesList[(int)_ID.ID_BGMUSIC] as string);
          _values.m_CopySceneID        = Convert.ToInt32(valuesList[(int)_ID.ID_COPYSCENEID] as string);
          _values.m_DefencePosX [0]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSX1] as string);
          _values.m_DefencePosX [1]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSX2] as string);
          _values.m_DefencePosX [2]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSX3] as string);
          _values.m_DefencePosX [3]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSX4] as string);
          _values.m_DefencePosX [4]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSX5] as string);
          _values.m_DefencePosX [5]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSX6] as string);
          _values.m_DefencePosX [6]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSX7] as string);
          _values.m_DefencePosX [7]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSX8] as string);
          _values.m_DefencePosX [8]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSX9] as string);
          _values.m_DefencePosX [9]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSX10] as string);
          _values.m_DefencePosX [10]   = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSX11] as string);
          _values.m_DefencePosZ [0]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSZ1] as string);
          _values.m_DefencePosZ [1]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSZ2] as string);
          _values.m_DefencePosZ [2]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSZ3] as string);
          _values.m_DefencePosZ [3]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSZ4] as string);
          _values.m_DefencePosZ [4]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSZ5] as string);
          _values.m_DefencePosZ [5]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSZ6] as string);
          _values.m_DefencePosZ [6]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSZ7] as string);
          _values.m_DefencePosZ [7]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSZ8] as string);
          _values.m_DefencePosZ [8]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSZ9] as string);
          _values.m_DefencePosZ [9]    = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSZ10] as string);
          _values.m_DefencePosZ [10]   = Convert.ToSingle(valuesList[(int)_ID.ID_DEFENCEPOSZ11] as string);
          _values.m_EdgeLength         = Convert.ToInt32(valuesList[(int)_ID.ID_EDGELENGTH] as string);
          _values.m_Length             = Convert.ToInt32(valuesList[(int)_ID.ID_LENGTH] as string);
          _values.m_Name               = valuesList[(int)_ID.ID_NAME] as string;
          _values.m_Obstacle           = valuesList[(int)_ID.ID_OBSTACLE] as string;
          _values.m_PlayerViewRadius   = Convert.ToInt32(valuesList[(int)_ID.ID_PLAYERVIEWRADIUS] as string);
          _values.m_ResName            = valuesList[(int)_ID.ID_RESNAME] as string;
          _values.m_SceneID            = Convert.ToInt32(valuesList[(int)_ID.ID_SCENEID] as string);
          _values.m_SceneMapHeight     = Convert.ToInt32(valuesList[(int)_ID.ID_SCENEMAPHEIGHT] as string);
          _values.m_SceneMapLogicWidth = Convert.ToInt32(valuesList[(int)_ID.ID_SCENEMAPLOGICWIDTH] as string);
          _values.m_SceneMapTexture    = valuesList[(int)_ID.ID_SCENEMAPTEXTURE] as string;
          _values.m_SceneMapWidth      = Convert.ToInt32(valuesList[(int)_ID.ID_SCENEMAPWIDTH] as string);
          _values.m_Type               = Convert.ToInt32(valuesList[(int)_ID.ID_TYPE] as string);
          _values.m_Width              = Convert.ToInt32(valuesList[(int)_ID.ID_WIDTH] 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);
          }
      }