Stoliki
This commit is contained in:
1 parent
3beae3b580
commit
9dc19d8331
5 files changed
+21
-8
No files matched your search
@@ -5,13 +5,12 @@ import java.util.ArrayList;
|
||||
import desmoj.core.simulator.Entity;
|
||||
import desmoj.core.simulator.Model;
|
||||
|
||||
public class Table extends Entity {
|
||||
public class Table {
|
||||
|
||||
protected ArrayList<Client> clientsAtTheTable;
|
||||
int hasSeats;
|
||||
|
||||
public Table(Model arg0, String arg1, boolean arg2) {
|
||||
super(arg0, arg1, arg2);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ public class Table2Seats extends Table{
|
||||
public Table2Seats(Model arg0, String arg1, boolean arg2) {
|
||||
super(arg0, arg1, arg2);
|
||||
this.clientsAtTheTable=new ArrayList<>();
|
||||
hasSeats=2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ public class Table4Seats extends Table {
|
||||
public Table4Seats(Model arg0, String arg1, boolean arg2) {
|
||||
super(arg0, arg1, arg2);
|
||||
this.clientsAtTheTable=new ArrayList<>();
|
||||
hasSeats=4;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -92,6 +92,14 @@ public class AnimPanel extends JPanel implements PropertyChangeListener
|
||||
|
||||
System.out.println("Model tables " + (model.getTable4Count()+model.getTable4Count()));
|
||||
|
||||
for (int i=0;i<model.getTables().size();i++)
|
||||
{
|
||||
JLabel label = new JLabel("0/" + model.getTables().get(i).getSeatCunt());
|
||||
tables.add(label);
|
||||
label.setBounds(100+i*30, 400+20*(i/10), 100, 25);
|
||||
add(label);
|
||||
}
|
||||
/*
|
||||
for (int i=0;i<model.getTable2Count();i++)
|
||||
{
|
||||
JLabel label = new JLabel("0/2");
|
||||
@@ -106,6 +114,7 @@ public class AnimPanel extends JPanel implements PropertyChangeListener
|
||||
label.setBounds(100+i*30, 400, 100, 25);
|
||||
add(label);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -260,17 +260,20 @@ public class StartPanel extends JPanel
|
||||
frame.getCanteen().setCashierCount((int)cashierSpinner.getValue());
|
||||
frame.getCanteen().setCookCount((int)cookSpinner.getValue());
|
||||
frame.getCanteen().setTable2Count((int)table2Spinner.getValue());
|
||||
for (int i=0;i<(int)table2Spinner.getValue();i++)
|
||||
frame.getCanteen().addTable2();
|
||||
|
||||
frame.getCanteen().setTable4Count((int)table4Spinner.getValue());
|
||||
for (int i=0;i<(int)table4Spinner.getValue();i++)
|
||||
frame.getCanteen().addTable4();
|
||||
|
||||
frame.getCanteen().setMinMealCount((int)minValueIngredientSpinner.getValue());
|
||||
//frame.getCanteen().setClientArrivialTime(Double.parseDouble(Integer.toString((int)minTimeClientSpinner.getValue())), Double.parseDouble(Integer.toString((int)maxTimeClientSpinner.getValue())));
|
||||
|
||||
|
||||
|
||||
//if (frame.getCanteen()!=null) System.out.println("NIE NULL");
|
||||
canteenThread.start();
|
||||
for (int i=0;i<(int)table2Spinner.getValue();i++)
|
||||
frame.getCanteen().addTable2();
|
||||
for (int i=0;i<(int)table4Spinner.getValue();i++)
|
||||
frame.getCanteen().addTable4();
|
||||
|
||||
|
||||
System.out.println("Watek wystartowany");
|
||||
frame.getAnimPanel().drawPanel();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user