67. talk() CO
public String talk() {
//
if (!saidCO) { // CO
//
if (!myDivinationQueue.isEmpty() &&
myDivinationQueue.peekLast().getResult() == Species.WEREWOLF) {
saidCO = true;
ContentBuilder builder = new ComingoutContentBuilder(me,
Role.SEER);
return new Content(builder).getText();
}
}
CO
68. talk()
//
else {
if (!myDivinationQueue.isEmpty()) {
Judge divination = myDivinationQueue.poll();
ContentBuilder builder = new
DivinedResultContentBuilder(divination.getTarget(),
divination.getResult());
return new Content(builder).getText();
} //
}
return Content.OVER.getText();
}
69. talk()
public String talk() {
//
if (!saidCO) {
if (!myDivinationQueue.isEmpty() && myDivinationQueue.peekLast().getResult() == Species.WEREWOLF) {
saidCO = true;
ContentBuilder builder = new ComingoutContentBuilder(me, Role.SEER);
return new Content(builder).getText();
}
} else {//
if (!myDivinationQueue.isEmpty()) {
Judge divination = myDivinationQueue.poll();
ContentBuilder builder = new DivinedResultContentBuilder(divination.getTarget(), divination.getResult());
return new Content(builder).getText();
}
}
return Content.OVER.getText(); //
}
70. • GameInfo
– GameInfo.getTalkList() List<Talk>
• Talk
– getAgent() Agent ID
– getText() String
•
– “DIVINED Agent[04] HUMAN” (Agent[04] )
– getDay() int
– getIdx() int
– getTurn()
int
80. Player
Player
•
• update getName, initialize
n initialize(GameInfo, GameSetting)
n update(GameInfo) n getName()
n dayStart() n talk()
n whisper() n vote()
n attack() n divine()
n guard() n finish()
133. ----------------------------------------------------------------------
public class FileCopy(){
private String f1;
private String f2;
public void main( String[] args ) throws Exception{
FileCopy a = new FileCopy();
a.f1 = new File( args[0] );
a.f2 = new File( args[1] );
a.run( 1024 );}
private void run( int i ) throws Exception{
FileInputStream s1 = new FileInputStream( f1 );
FileOutputStream s2 = new FileOutputStream( f2 );
byte[] b = new byte[i];
Int j;
while( (j=s1.read(b))>0) s2.write( b,0,j);
s1.close();
s2.close();
}}