From dd25e0be0ade0610c42462b6dbf3247b2d7b3345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Gejdo=C5=A1?= Date: Thu, 23 Apr 2026 13:56:20 +0000 Subject: [PATCH] capacity get --- du6/a_station.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/du6/a_station.c b/du6/a_station.c index c4be3ae..86e740d 100644 --- a/du6/a_station.c +++ b/du6/a_station.c @@ -55,11 +55,21 @@ void add_target_capacity(struct station* station,const char* target, int capacit } int get_target_capacity(struct station* station,const char* target){ + + int kolaj = select_track (station, target); // z targetu zistim o ktoru kolaj sa jedna + struct car* vagon = station -> tracks[kolaj]; // nacitam si vagon nech zistim jeho kapacitu + while (vagon) { + if (strcmp (kolaj -> value, target) == 0) {// skopirovane z add capacity + return vagon -> capacity; + } + vagon = vagon -> next; //ak nenajdem zhodu, skusim dalsi vagon na kolaji + } return 0; } int count_targets(struct station* station){ - return 0; + int targets = 0; + return targets; } int count_capacity(struct station* station){