ach
This commit is contained in:
parent
0f80ed26de
commit
54f923379a
@ -53,11 +53,32 @@ void add_target_capacity(struct station* station,const char* target, int capacit
|
|||||||
}
|
}
|
||||||
|
|
||||||
int get_target_capacity(struct station* station,const char* target){
|
int get_target_capacity(struct station* station,const char* target){
|
||||||
|
for(int i=0;i<station->track_count;i++){
|
||||||
|
struct car* newCar= station->tracks[i];
|
||||||
|
while (newCar->value!=NULL)
|
||||||
|
{
|
||||||
|
if(strcmp(newCar->value,target)==0){
|
||||||
|
return newCar->capacity;
|
||||||
|
}
|
||||||
|
newCar=newCar->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int count_targets(struct station* station){
|
int count_targets(struct station* station){
|
||||||
return 0;
|
int counter=0;
|
||||||
|
for(int i=0;i<station->track_count;i++){
|
||||||
|
struct car* newCar= station->tracks[i];
|
||||||
|
while (newCar->value!=NULL)
|
||||||
|
{
|
||||||
|
counter+=1;
|
||||||
|
newCar=newCar->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
int count_capacity(struct station* station){
|
int count_capacity(struct station* station){
|
||||||
|
Loading…
Reference in New Issue
Block a user