File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export function record(cx: Context) {
3535 } ) ;
3636}
3737
38- export function undo ( cx : Context ) : { x : number ; y : number } | undefined {
38+ export function undo ( cx : Context ) {
3939 const history = get ( cx . history ) ;
4040
4141 // 最新に戻るため、記録しておく
@@ -69,7 +69,7 @@ export function undo(cx: Context): { x: number; y: number } | undefined {
6969 } ;
7070}
7171
72- export function redo ( cx : Context ) : { x : number ; y : number } | undefined {
72+ export function redo ( cx : Context ) {
7373 const history = get ( cx . history ) ;
7474
7575 // 0. 一般
@@ -84,24 +84,18 @@ export function redo(cx: Context): { x: number; y: number } | undefined {
8484 const stash = popStash ( cx ) ;
8585 if ( ! stash ) {
8686 // case 2. すでに最新に戻ったことがある
87- return undefined ;
87+ return ;
8888 }
8989 // case 1. 最新に戻る
9090 restore ( cx , stash ) ;
91- return {
92- x : stash . playerX ,
93- y : stash . playerY ,
94- } ;
91+ return ;
9592 }
9693 history . index += 2 ;
9794
9895 restore ( cx , snapshot ) ;
9996 cx . history . set ( history ) ;
10097
101- return {
102- x : snapshot . playerX ,
103- y : snapshot . playerY ,
104- } ;
98+ return ;
10599}
106100
107101// 状態を巻き戻す
You can’t perform that action at this time.
0 commit comments