Skip to content

Features/game update#3

Open
matthijsvanvliet wants to merge 5 commits into
developmentfrom
Features/GameUpdate
Open

Features/game update#3
matthijsvanvliet wants to merge 5 commits into
developmentfrom
Features/GameUpdate

Conversation

@matthijsvanvliet
Copy link
Copy Markdown
Collaborator

  • Added unfinished GameUpdate class
  • Added unfinished and incomplete unit tests

Vliet,Matthijs M.B. van added 3 commits March 10, 2021 11:09
@Deruago Deruago changed the base branch from master to development March 17, 2021 09:50
@Deruago Deruago added the enhancement New feature or request label Mar 17, 2021
Copy link
Copy Markdown
Owner

@Deruago Deruago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires some updates


public:
Move(Node* startLocation_, Node* endLocation_, int price_);
~Move();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make default

void UpdateBudgetCompetitor(const int id, int newBudget);
void UpdateBudgetOur(int newBudget);
void UpdateOccupiedLocations(std::vector<Node*> nodes);
void UpdateOurLocation(const int location);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const int location -> const Move move

Comment thread lib/Game/Update/GameUpdate.cpp Outdated
Comment on lines +70 to +71
#include <iostream>
using namespace std;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is temporary

Comment thread lib/Game/Update/GameUpdate.cpp Outdated

for (auto vec : graph->GetLocations())
{
if (sptSet[vec->GetId() - 1] == false && dist[vec->GetId() - 1] <= min)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const auto vectorId = vec->GetId() - 1;

{
if (con.GetNode()->GetId() == endNode->GetId())
{
return new Connection(con.GetNode(), con.GetPrice());
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New connection?

{
for (auto ocNode : occupiedNodes)
{
if (ocNode->IsCritical() && ocNode->GetId() == node->GetId())
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NodeId instead of ocNode->GetId()

Comment thread lib/Game/Update/GameUpdate.cpp Outdated

void PekingExpress::GameUpdate::ApplyOurMove(const int location)
{
UpdateOurLocation(location);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misses update budget

Comment thread lib/Game/Update/GameUpdate.cpp Outdated
}

void PekingExpress::GameUpdate::UpdateCompetitorLocation(int location)
const int PekingExpress::GameUpdate::NextMove()
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complex function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants