Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

funkcja doEnd() MrDarkness19&Nircek #15

Closed
wants to merge 18 commits into from
Closed

Conversation

MrDarkness19
Copy link
Collaborator

No description provided.

@Nircek Nircek mentioned this pull request Sep 2, 2018
Copy link
Member

@Nircek Nircek left a comment

Choose a reason for hiding this comment

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

dużo zmian trzeba zrobić

main.cpp Outdated

if(( sciezka = opendir( mapy.c_str() ) ) ) {
while(( plik = readdir( sciezka ) ) )
if(string(plik->d_name).substr(string(plik->d_name).size()-3) == string(".map"))
Copy link
Member

Choose a reason for hiding this comment

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

terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::substr: __pos (which is 4294967294) > this->size() (which is 1)

Copy link
Member

Choose a reason for hiding this comment

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

poza tym zamiast size()-3 powinno być size()-4, bo .map ma 4 znaki długości, więc potrzebujemy pobrać 4 ostatnie znaki

p1.sort();

index = p1.search(prev_file);
prev_file = p1.get(index+1);
Copy link
Member

Choose a reason for hiding this comment

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

w przypadku, kiedy nie ma następnego pliku prev_file jest ustawiany na ":", a funkcja zwraca true... albo niech funkcja zwróci false (żeby zakończyć program i wyświetlić game over) albo niech prev_file będzie zawierał pierwszy plik (jeżeli chcemy ∞ leveli).

main.cpp Outdated
index = p1.search(prev_file);
prev_file = p1.get(index+1);
file_name = mapy+"/"+prev_file;
if(index==(size_t)-1)
Copy link
Member

Choose a reason for hiding this comment

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

index jest równy -1 (bez zewnętrznej zmiany zmiennych) TYLKO I WYŁĄCZNIE wtedy, kiedy jest pierwsze wywołanie tej funkcji, wtedy ta funkcja zwróci false i program od razu się wyłączy

Zmiana odczytywania ostatnich znaków

Co-authored-by: Nircek <nircek-2103@protonmail.com>
@Nircek
Copy link
Member

Nircek commented Sep 16, 2018

Zamknięte z powodu przeniesienia wszystkich branchy na pre-alpha (#21). Będziemy potem mergować wszystko naraz. Wszystkie zmiany, które chciałbyś dokonać na tym branchu proszę wykonać na branchu pre-alpha.

@Nircek Nircek closed this Sep 16, 2018
@Nircek Nircek deleted the doEnd-func branch September 16, 2018 13:52
@Nircek Nircek added this to the v1.0 milestone Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants