Пример #1
0
        // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
        //     Constructor
        // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

        public TilePathSettingFactoryChangePathPermissionHelper(TilePathPermission pathPermission,
                                                                ITilePathSetting src, TileImpassableFlags impassableFlags, TileCannotPassingFlags cannotPassingFlags)
        {
            this.pathPermission     = pathPermission;
            this.src                = src;
            this.impassableFlags    = impassableFlags;
            this.cannotPassingFlags = cannotPassingFlags;
        }
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="impassableFlags">[NotNull] 通行設定フラグ</param>
        /// <exception cref="ArgumentNullException">cannotPattingFlagsがnullの場合</exception>
        public TilePathSettingPartialDeny(TileImpassableFlags impassableFlags)
        {
            if (impassableFlags is null)
            {
                throw new ArgumentNullException(
                          ErrorMessage.NotNull(nameof(impassableFlags)));
            }

            ImpassableFlags = impassableFlags;
        }
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="code">コード値</param>
 public TilePathSettingPartialDeny(int code) : base(code)
 {
     ImpassableFlags = new TileImpassableFlags(code);
 }
Пример #4
0
        private static ITilePathSetting Create_ImpassableToImpassable(TilePathPermission pathPermission,
                                                                      ITilePathSetting src, TileImpassableFlags impassableFlags)
        {
            if (pathPermission == TilePathPermission.PartialDeny)
            {
                return(new TilePathSettingPartialDeny(impassableFlags ?? src.ImpassableFlags)
                {
                    PathOption = src.PathOption,
                    IsCounter = src.IsCounter
                });
            }

            throw new InvalidOperationException();
        }
Пример #5
0
 /// <summary>
 /// 通行設定を変更したインスタンスを生成する。
 /// </summary>
 /// <param name="pathPermission">[NotNull] 通行設定</param>
 /// <param name="src">[NotNull] 元データ</param>
 /// <param name="impassableFlags">[Nullable] 通行許可設定</param>
 /// <param name="cannotPassingFlags">[Nullable] 通行方向設定</param>
 /// <returns>変更後のインスタンス</returns>
 public static ITilePathSetting Create(TilePathPermission pathPermission, ITilePathSetting src,
                                       TileImpassableFlags impassableFlags = null, TileCannotPassingFlags cannotPassingFlags = null)
 {
     return(new TilePathSettingFactoryChangePathPermissionHelper(pathPermission, src,
                                                                 impassableFlags, cannotPassingFlags).Execute());
 }