Exemple #1
0
        /// <summary>
        /// 自身の情報を元にDBDataインスタンスを生成する。
        /// </summary>
        /// <param name="typeId">[Range(0, TypeDescList.Count - 1)] タイプID</param>
        /// <param name="start">[Range(0, TypeDescList[typeId].DataDescList.Count - 1)] 始点データID</param>
        /// <param name="count">[Range(0, TypeDescList[typeId].DataDescList.Count)] 出力データ数</param>
        /// <returns>DBDataインスタンス</returns>
        /// <exception cref="ArgumentOutOfRangeException">typeId, start, countが指定範囲外の場合</exception>
        public DBData GenerateDBData(TypeId typeId, DataId start, int count)
        {
            var       typeIdMax = TypeDescList.Count - 1;
            const int typeIdMin = 0;

            if (typeId > typeIdMax)
            {
                throw new ArgumentOutOfRangeException(
                          ErrorMessage.OutOfRange(nameof(typeId), typeIdMin, typeIdMax, typeId));
            }

            var       dataDescListCount = TypeDescList[typeId].DataDescList.Count;
            var       startMax          = dataDescListCount - 1;
            const int startMin          = 0;

            if (start > startMax)
            {
                throw new ArgumentOutOfRangeException(
                          ErrorMessage.OutOfRange(nameof(start), startMin, startMax, start));
            }

            var       countMax = dataDescListCount;
            const int countMin = 0;

            if (count < countMin || countMax < count)
            {
                throw new ArgumentOutOfRangeException(
                          ErrorMessage.OutOfRange(nameof(count), countMin, countMax, count));
            }

            if (dataDescListCount - start < count)
            {
                throw new ArgumentException(
                          $"{nameof(start)}および{nameof(count)}が有効な範囲を示していません。");
            }

            return(TypeDescList[typeId].GenerateDBData(start, count));
        }
Exemple #2
0
 /// <summary>
 /// 指定したタイプID、データIDの項目値リストを取得する。
 /// </summary>
 /// <param name="typeId">[Range(0, {対象DBのタイプ数} - 1)] タイプID</param>
 /// <param name="dataId">[Range(0, {対象DB・タイプのデータ数} - 1)] データID</param>
 /// <returns>DB項目値リスト</returns>
 /// <exception cref="ArgumentOutOfRangeException">typeId, dataId が指定範囲外の場合</exception>
 public DBItemValueList GetItemValueList(TypeId typeId, DataId dataId)
 => TypeDescList[typeId].GetItemValueList(dataId);
Exemple #3
0
 /// <summary>
 /// 指定したタイプID、データID、項目IDの項目値を取得する。
 /// </summary>
 /// <param name="typeId">[Range(0, {対象DBのタイプ数} - 1)] タイプID</param>
 /// <param name="dataId">[Range(0, {対象DB・タイプのデータ数} - 1)] データID</param>
 /// <param name="itemId">[Range(0, {対象DB・タイプ・データの項目数} - 1)] データID</param>
 /// <returns>DB項目値リスト</returns>
 /// <exception cref="ArgumentOutOfRangeException">typeId, dataId, itemId が指定範囲外の場合</exception>
 public DBItemValue GetItemValue(TypeId typeId, DataId dataId, ItemId itemId)
 => TypeDescList[typeId].GetItemValue(dataId, itemId);
Exemple #4
0
 /// <summary>
 /// 指定したタイプIDのデータ情報リストを取得する。
 /// </summary>
 /// <param name="typeId">[Range(0, {対象DBのタイプ数} - 1)] タイプID</param>
 /// <param name="dataId">[Range(0, {対象DB・タイプのデータ数} - 1)] データID</param>
 /// <returns>DBデータ情報リスト</returns>
 /// <exception cref="ArgumentOutOfRangeException">typeId, dataId が指定範囲外の場合</exception>
 public DatabaseDataDesc GetDataDesc(TypeId typeId, DataId dataId)
 => TypeDescList[typeId].DataDescList[dataId];