コード例 #1
0
 static public bool copyBool(ref bool _strData, IDictionary _iDict, string _strKey, bool _bLog = true)
 {
     if (DataCopyUtil.checkContainsValue(_iDict, _strKey, _bLog))
     {
         _strData = (bool)_iDict[_strKey];
         return(true);
     }
     return(false);
 }
コード例 #2
0
 static public bool copyLongToInt(ref int _lData, IDictionary _iDict, string _strKey, bool _bLog = true)
 {
     if (DataCopyUtil.checkContainsValue(_iDict, _strKey, _bLog))
     {
         _lData = (int)(long)_iDict[_strKey];
         return(true);
     }
     return(false);
 }
コード例 #3
0
 static public bool copyFloatV(ref float _strData, IDictionary _iDict, string _strKey, bool _bLog = true)
 {
     if (DataCopyUtil.checkContainsValue(_iDict, _strKey, _bLog))
     {
         var temp = _iDict[_strKey];
         _strData = float.Parse(temp.ToString());
         return(true);
     }
     return(false);
 }
コード例 #4
0
        // SpreadSheetデータを取得する
        static private void search(IDictionary _dict, ref bool _bRecord, ref SpreadSheetData _data, ref List <SpreadSheetData> _list)
        {
            foreach (var key in _dict.Keys)
            {
                if (_bRecord)
                {
                    if (key.Equals("row") == true)
                    {
                        //Debug.Log (key);
                        //Debug.Log (_dict [key]);
                        //Debug.Log (_dict [key].GetType());
                        _data.row = int.Parse((string)_dict[key]);
                        //_data.row = int.Parse((string)_dict [key]);
                    }
                    else if (key.Equals("col") == true)
                    {
                        //DataCopyUtil.copyLongToInt (ref _data.col, _dict, key.ToString());
                        _data.col = int.Parse((string)_dict[key]);
                        //_data.col = int.Parse(_dict [key]);
                    }
                    else if (key.Equals("$t") == true)
                    {
                        DataCopyUtil.copyString(ref _data.param, _dict, key.ToString());
                    }
                    else
                    {
                        // むしろエラー
                    }
                }
                if (key.Equals("gs$cell") == true)
                {
                    _data    = new SpreadSheetData();
                    _bRecord = true;
                }

                if (_dict[key] is IDictionary)
                {
                    //Debug.Log ("idict");
                    search((IDictionary)_dict[key], ref _bRecord, ref _data, ref _list);
                }
                else if (_dict[key] is IList)
                {
                    IList use_list = (IList)_dict[key];
                    //Debug.Log (use_list.Count);
                    foreach (IDictionary indict in use_list)
                    {
                        search((IDictionary)indict, ref _bRecord, ref _data, ref _list);
                    }
                }
                else
                {
                    ;                    // nocalled
                }

                if (key.Equals("gs$cell") == true)
                {
                    _list.Add(_data);
                    _bRecord = false;
                }
            }
        }