/*
* This file is part of RuneOptimizer.
*
* RuneOptimizer is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* RuneOptimizer is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* RuneOptimizer. If not, see .
*/
/**
* @file team.c
*
* Implementation of the team command.
*
* This file implements the team command declared in {@link team.h}.
*/
#include
#include
#include "../runeoptimizer.h"
#include "../error/error.h"
#include "team.h"
extern int team(int argc, char *argv[]){
if (argc < 1){
fprintf(stderr, "Command team needs an action\n");
return(ERROR_INPUT_TEAM_NO_ACTION);
}
if (strcmp(argv[0], "list") == 0){
return(team_list(argc - 1, argv + 1));
}
else if (strcmp(argv[0], "create") == 0){
return(team_create(argc - 1, argv + 1));
}
else if (strcmp(argv[0], "delete") == 0){
return(team_delete(argc - 1, argv + 1));
}
else if (strcmp(argv[0], "update") == 0){
return(team_edit(argc - 1, argv + 1));
}
else if (strcmp(argv[0], "add_unit") == 0){
return(team_add_unit(argc - 1, argv + 1));
}
else if (strcmp(argv[0], "remove_unit") == 0){
return(team_remove_unit(argc - 1, argv + 1));
}
else{
fprintf(stderr, "Invalid action for team command: %s\n", argv[0]);
return(ERROR_INPUT_TEAM_INVALID_ACTION);
}
}