comparison src/pathfinder/mergetest/EditorSimulator.java @ 160:e9047957acc2

merge with pathfinder.simulator.*
author kent
date Tue, 26 Aug 2008 19:46:03 +0900
parents 6a3c982bd72a
children 8910ffda5273
comparison
equal deleted inserted replaced
159:a5c56bff6359 160:e9047957acc2
1 package pathfinder.mergetest; 1 package pathfinder.mergetest;
2 2
3 import java.util.Queue; 3 import java.util.Queue;
4
5 import pathfinder.mergetest.channels.ChannelSimulator;
6 import pathfinder.mergetest.channels.NetworkSimulator;
4 7
5 import remoteeditor.command.REPCommand; 8 import remoteeditor.command.REPCommand;
6 import remoteeditor.network.REP; 9 import remoteeditor.network.REP;
7 import sample.merge.TranslaterImp1; 10 import sample.merge.TranslaterImp1;
8 11
14 protected ChannelSimulator<REPCommand> cs; 17 protected ChannelSimulator<REPCommand> cs;
15 //protected Queue<REPCommand> CmdList; 18 //protected Queue<REPCommand> CmdList;
16 private TranslaterImp1 translater; 19 private TranslaterImp1 translater;
17 protected Text text; 20 protected Text text;
18 protected boolean running=true; 21 protected boolean running=true;
22 protected int semaIP;
19 23
20 public EditorSimulator(int _eid, NetworkSimulator<REPCommand> _ns, String[] strings, String _name) { 24 public EditorSimulator(int _eid, NetworkSimulator<REPCommand> _ns, String[] strings, String _name) {
21 super(_name); 25 super(_name);
22 eid = _eid; 26 eid = _eid;
23 ns = _ns; 27 ns = _ns;
24 28
25 translater = new TranslaterImp1(_eid); 29 translater = new TranslaterImp1(_eid);
26 if(strings != null) text = new Text(strings); 30 if(strings != null) text = new Text(strings);
27 cs = ns.connect(); 31 cs = new ChannelSimulator<REPCommand>(ns);
32 cs.connect(semaIP);
28 } 33 }
29 34
30 public void setOwner(boolean f){ 35 public void setOwner(boolean f){
31 //isOwner = f; 36 //isOwner = f;
32 } 37 }
118 } 123 }
119 */ 124 */
120 public Text getText(){ 125 public Text getText(){
121 return text; 126 return text;
122 } 127 }
128
129 public ChannelSimulator<REPCommand> getChannelforUser(){
130 return cs.createConjugatedChannel();
131 }
132
133
123 } 134 }