// _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ // 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="cannotPassingFlags">[NotNull] 通行設定フラグ</param> /// <exception cref="ArgumentNullException">cannotPattingFlagsがnullの場合</exception> public TilePathSettingAllow(TileCannotPassingFlags cannotPassingFlags) { if (cannotPassingFlags is null) { throw new ArgumentNullException( ErrorMessage.NotNull(nameof(cannotPassingFlags))); } CannotPassingFlags = cannotPassingFlags; }
// _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ // Private Static Method // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ private static ITilePathSetting Create_CannotPassingToCannotPassing(TilePathPermission pathPermission, ITilePathSetting src, TileCannotPassingFlags cannotPassingFlags) { if (pathPermission == TilePathPermission.Allow) { return(new TilePathSettingAllow(cannotPassingFlags ?? src.CannotPassingFlags) { PathOption = src.PathOption, IsCounter = src.IsCounter }); } if (pathPermission == TilePathPermission.Dependent) { return(new TilePathSettingDependent(cannotPassingFlags ?? src.CannotPassingFlags) { PathOption = src.PathOption, IsCounter = src.IsCounter }); } throw new InvalidOperationException(); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="code">コード値</param> public TilePathSettingAllow(int code) : base(code) { CannotPassingFlags = new TileCannotPassingFlags(code); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="code">コード値</param> public TilePathSettingDependent(int code) : base(code) { CannotPassingFlags = new TileCannotPassingFlags(code); }
/// <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()); }