Esempio n. 1
0
        protected override string Execute(string command, MissionStatus mission)
        {
            var    splited = command.Split(' ');
            string res;

            if (splited.Length < 3)
            {
                return("Wrong syntax. Type list -c [category].");
            }
            if (splited[2] == "programming")
            {
                res = "APISql \n" +
                      "SQL \n" +
                      "Log \n";
            }
            else if (splited[2] == "engineer")
            {
                res = "n/a";
            }
            else if (splited[2] == "scientist")
            {
                res = "n/a";
            }
            else
            {
                res = "there is no ctegory " + splited[2] + " type programming, engineer or scientist";
            }
            return(res);
        }
Esempio n. 2
0
 protected override string Execute(string command, MissionStatus mission)
 {
     return("This command is sending SQL command to server and returning it's respond \n" +
            "-h           : help\n" +
            "-l           : list of sql commands with short description \n" +
            "-s [command] : sending command");
 }
Esempio n. 3
0
        protected override string Execute(string command, MissionStatus mission)
        {
            string help = "To look for specyfic category of commands type -c \n" +
                          "APISql \n" +
                          "SQL \n" +
                          "Log \n";

            return(help);
        }
Esempio n. 4
0
        public string Run(string command, MissionStatus mission)
        {
            var splited = command.Split();

            if (splited[0].ToLower() == name.ToLower())
            {
                return(Execute(command, mission));
            }
            return(_next == null ? "No such command. Type list for list of commands." : _next.Run(command, mission));
        }
Esempio n. 5
0
        protected override string Execute(string command, MissionStatus mission)
        {
            string help =
                "This command is handling Log administration\n" +
                "-h                  : help\n" +
                "-sh                 : showing all logs\n" +
                "-sc                 : showing logs of one category\n" +
                "-n [category] [log] : adding new log \n";

            return(help);
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            MissionStatus  status    = new MissionStatus();
            ChainGenerator generator = new ChainGenerator();

            while (true)
            {
                string command = Console.ReadLine();
                Console.WriteLine(generator.ExecuteCommand(command, status));
            }
        }
Esempio n. 7
0
        protected override string Execute(string command, MissionStatus mission)
        {
            string help =
                "This command is handling communication with server thru API \n" +
                "-h                                       :   help for command\n" +
                "-c  [mission] [columns]                  :   creating new mission of server\n" +
                "-su [mission] [atribut] [times + values] :   sending update of atribut\n" +
                "-ru [mission] [atribut] [time]           :   downloading update of atribut from selected time and saving it to db\n" +
                "-gc [mission]                            :   checking if time of atribut is up to date\n";

            return(help);
        }
Esempio n. 8
0
        public string Run(string command, MissionStatus mission)
        {
            var splited = command.Split();

            if (splited.Length == 1)
            {
                return(name == "-h" ? Execute(command, mission) : _next.Run(command, mission));
            }
            if (splited[1].ToLower() == name.ToLower())
            {
                return(Execute(command, mission));
            }
            return(_next == null ? "No such argument. Type -h to find help." : _next.Run(command, mission));
        }
Esempio n. 9
0
 protected override string Execute(string command, MissionStatus mission)
 {
     return(SendToServer(GenerateCommand(command), mission.IP, mission.port));
 }
Esempio n. 10
0
 protected override string Execute(string command, MissionStatus mission)
 {
     return(_aguments[0].Run(command, mission));
 }
Esempio n. 11
0
 public string ExecuteCommand(string command, MissionStatus mission)
 {
     return(commands[0].Run(command, mission));
 }
Esempio n. 12
0
 protected abstract string Execute(string command, MissionStatus mission);
Esempio n. 13
0
 protected override string Execute(string command, MissionStatus mission)
 {
     return("Select \nCreate");
 }