Commit be0c8e93 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

QLinkedList -> std::list

parent 4c4dea77
Pipeline #259027 passed with stage
in 7 minutes and 18 seconds
......@@ -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};
}
......
......@@ -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
{
......
......@@ -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 = QLinkedList<Standing *>;
using steps_T = std::list<Standing *>;
// type of hash value
using hash_T = unsigned long long;
......
......@@ -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 = QLinkedList<Field>;
using suggestions_T = std::list<Field>;
class Standing;
// callback function to convert a position of the sample into coordinates, and update suggestions accordingly
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment