Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Loic Guegan
ochess
Commits
37155903
Commit
37155903
authored
Nov 18, 2020
by
Loic Guegan
Browse files
Display move just for testing
parent
584a7746
Pipeline
#217903559
passed with stage
in 8 minutes and 23 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
src/model/Game.cpp
src/model/Game.cpp
+8
-2
src/model/History.hpp
src/model/History.hpp
+3
-0
No files found.
src/model/Game.cpp
View file @
37155903
...
...
@@ -75,12 +75,18 @@ bool Game::Move(Coord src, Coord dst) {
bool
Game
::
Move
(
ochess
::
model
::
Move
*
m
){
if
(
m
->
isLongCastle
||
m
->
isShortCastle
){
std
::
cout
<<
"Castle"
<<
std
::
endl
;
return
(
Castle
(
m
->
isLongCastle
));
bool
ret
=
Castle
(
m
->
isLongCastle
);
H
.
GetCurrentState
()
->
SANMove
=
m
->
SANMove
;
H
.
GetCurrentState
()
->
editorMove
.
move
=
m
->
SANMove
;
return
(
ret
);
}
std
::
cout
<<
" dst: "
<<
m
->
dst
<<
" ispawn: "
<<
m
->
isPawn
<<
" piece: "
<<
m
->
piece
<<
std
::
endl
<<
std
::
flush
;
Coord
src
=
A
.
FindSrc
(
m
->
dst
,
m
->
col
,
m
->
isPawn
,
m
->
piece
);
bool
ret
=
this
->
Move
(
src
.
GetXY
(),
m
->
dst
);
H
.
GetCurrentState
()
->
SANMove
=
m
->
SANMove
;
H
.
GetCurrentState
()
->
editorMove
.
move
=
m
->
SANMove
;
return
(
this
->
Move
(
src
.
GetXY
(),
m
->
dst
)
);
return
(
ret
);
}
void
Game
::
Next
()
{
...
...
src/model/History.hpp
View file @
37155903
...
...
@@ -101,6 +101,9 @@ public:
Move
*
GetInitialState
(){
return
(
&
(
this
->
InitialState
));
}
Move
*
GetCurrentState
(){
return
(
this
->
CurrentState
);
}
};
}
// namespace model
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment