]> git.somenet.org - pub/jan/sbc.git/blob - src/main/java/at/ac/tuwien/sbc/valesriegler/xvsm/cook/Cook.java
Implement handleWaitingGroup+handleOrderRequest for XVSM waiter
[pub/jan/sbc.git] / src / main / java / at / ac / tuwien / sbc / valesriegler / xvsm / cook / Cook.java
1 package at.ac.tuwien.sbc.valesriegler.xvsm.cook;
2
3 import java.util.List;
4
5 import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory;
7
8 import at.ac.tuwien.sbc.valesriegler.pizzeria.gui.DEP_Table;
9 import at.ac.tuwien.sbc.valesriegler.xvsm.XVSMConnector;
10 import at.ac.tuwien.sbc.valesriegler.xvsm.waiter.Waiter;
11
12 public class Cook {
13         private static final String USAGE = "Cook needs exactly one parameter: ID of type Integer";
14         private static final Logger log = LoggerFactory.getLogger(Cook.class);
15         
16         private int id;
17         private XVSMConnector xvsm;
18
19         public static void main(String[] args) {
20                 if(args.length != 1) {
21                         throw new IllegalArgumentException(USAGE);
22                 }
23                 
24                 int parsedId = 0;
25                 try {
26                         parsedId = Integer.parseInt(args[0]);
27                 } catch (NumberFormatException e) {
28                         log.error(USAGE);
29                         return;
30                 }
31                 
32                 Cook cook = new Cook(parsedId);
33                 cook.start();
34         }
35
36         private void start() {
37                 initSpaceCommunication();
38                 
39
40                 
41         }
42         
43         private void initSpaceCommunication() {
44                 xvsm = new XVSMConnector();
45                 xvsm.initSpaceCommunication();
46
47                 log.info("Space Connection established!");
48                 
49                 
50         }
51
52         public Cook(int id) {
53                 this.id = id;
54                 log.info("I AM A Cook WITH ID {}", id);
55         }
56
57 }