get rid of ChainControls
[fleet.git] / misc / obsolete-ships / DuplicatorShip.java
1 package edu.berkeley.fleet.interpreter.ships;
2 import edu.berkeley.fleet.interpreter.*;
3 import edu.berkeley.fleet.*;
4
5 import java.util.*;
6 import java.io.*;
7
8 /**
9  * @author Dominic Antonelli <dantonel@berkeley.edu>
10  */
11 public class DuplicatorShip extends InterpreterShip {
12
13     DataInbox   in  = new DataInbox(this, "in");
14     DataOutbox  out0 = new DataOutbox(this, "out0");
15     DataOutbox  out1 = new DataOutbox(this, "out1");
16     DataOutbox  out2 = new DataOutbox(this, "out2");
17     DataOutbox  out3 = new DataOutbox(this, "out3");
18
19     public DuplicatorShip (Interpreter fleet, String name) {
20         super(fleet, name);
21     }
22
23     public void service() {
24         if (in.dataReadyForShip()       && out0.readyForDataFromShip() && 
25             out1.readyForDataFromShip() && out2.readyForDataFromShip() &&
26             out3.readyForDataFromShip()) {
27             int data = in.removeDataForShip();
28             out0.addDataFromShip(data);
29             out1.addDataFromShip(data);
30             out2.addDataFromShip(data);
31             out3.addDataFromShip(data);
32         }
33     }
34
35 }
36