This commit is contained in:
Rastislav Želonka 2019-12-01 14:16:49 +01:00
parent 872a1e4875
commit 15fda00eee

View File

@ -1,6 +1,7 @@
#include "a_station.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
struct station* create_station(){
struct station* station = calloc(1,sizeof(struct station));
@ -65,10 +66,19 @@ void add_target_capacity(struct station* station,const char* target, int capacit
}
int get_target_capacity(struct station* station,const char* target){
int track = select_track(station,target);
struct car* start = station->tracks[track];
while(start->next != NULL){
if(strcmp(start->value,target)== 0){
return start->capacity;
}
start = start->next;
}
return 0;
}
int count_targets(struct station* station){
return 0;
}