Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Games
Bovo
Commits
be0c8e93
Commit
be0c8e93
authored
Oct 31, 2022
by
Albert Astals Cid
Browse files
QLinkedList -> std::list
parent
4c4dea77
Pipeline
#259027
passed with stage
in 7 minutes and 18 seconds
Changes
4
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
ai/gabor/ai_impl.cpp
View file @
be0c8e93
...
...
@@ -79,8 +79,8 @@ void AiImpl::stepServer(pos_T x, pos_T y)
void
AiImpl
::
undo
()
{
assert
(
!
previousStandings
.
empty
());
rememberedStanding
=
previousStandings
.
last
();
previousStandings
.
removeLast
();
rememberedStanding
=
previousStandings
.
back
();
previousStandings
.
pop_back
();
}
Field
AiImpl
::
think
()
...
...
@@ -289,8 +289,8 @@ Field AiImpl::openingBook()
}
else
if
(
rememberedStanding
.
stepCount
==
2
)
{
pos_T
x1
,
y1
,
x2
,
y2
;
int
dx
,
dy
;
x1
=
previousStandings
.
last
().
lastx
;
y1
=
previousStandings
.
last
().
lasty
;
x1
=
previousStandings
.
back
().
lastx
;
y1
=
previousStandings
.
back
().
lasty
;
if
(
!
(
1
<=
x1
&&
x1
<
table_size_x
-
1
&&
1
<=
y1
&&
y1
<
table_size_y
-
1
))
{
return
{
max_table_size
,
max_table_size
};
}
...
...
ai/gabor/ai_impl.h
View file @
be0c8e93
...
...
@@ -22,12 +22,12 @@
#ifndef BOVO_AI_IMPL_H
#define BOVO_AI_IMPL_H
#include
<QLinkedList>
#include
"ai_interface.h"
#include
"standing.h"
using
previous_standings_T
=
QLinkedList
<
Standing
>
;
#include
<list>
using
previous_standings_T
=
std
::
list
<
Standing
>
;
class
AiImpl
{
...
...
ai/gabor/node.h
View file @
be0c8e93
...
...
@@ -22,13 +22,13 @@
#ifndef BOVO_NODE_H
#define BOVO_NODE_H
#include
<QLinkedList>
#include
"ai_interface.h"
#include
"standing.h"
#include
<list>
// list of following steps
using
steps_T
=
QLinkedL
ist
<
Standing
*>
;
using
steps_T
=
std
::
l
ist
<
Standing
*>
;
// type of hash value
using
hash_T
=
unsigned
long
long
;
...
...
ai/gabor/standing.h
View file @
be0c8e93
...
...
@@ -22,11 +22,12 @@
#ifndef BOVO_STANDING_H
#define BOVO_STANDING_H
#include
<QLinkedList>
#include
<QVector>
#include
"ai_interface.h"
#include
<list>
// a mark on the table
using
mark_T
=
unsigned
char
;
// occurrences of a certain position
...
...
@@ -68,7 +69,7 @@ typedef count_T PatternCount[2][heurLevels];
// a row, column or diagonal of the table
using
sample_T
=
QVector
<
mark_T
>
;
// interesting fields for the two players for the next step
using
suggestions_T
=
QLinkedL
ist
<
Field
>
;
using
suggestions_T
=
std
::
l
ist
<
Field
>
;
class
Standing
;
// callback function to convert a position of the sample into coordinates, and update suggestions accordingly
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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