[*]前 次[#] [0]戻 [4]履歴
[1]最新 [2]最初 ▼[3]コメント欄

            
1/2頁 (13件)
5:ん 03/04 16:31
else tmp="順番違い。";
if (!(errCode==OthelloLogic.OK))
g.drawString(tmp,580,175);
}
private void drawMessagePicture(Graphics g,int errCode,String[] message){
Image tmp;
if ((errCode==OthelloLogic.PASS)) tmp=PASS;
else if((errCode==OthelloLogic.NG)) tmp=NG;
else tmp=NOTYOU;
drawMessageDrawing(g,errCode);
g.drawImage(tmp,580,430,this);
try {
g.setFont(new Font("MS ゴシック",Font.PLAIN,20));

for(int i=0;((i<message.length)&&(i<4));i++){
g.drawString(message[i],575,290+i*23);

}//for
}catch(Exception e) {}
}
private void put(int errCode){
this.errCD=errCode;this.messageStr=mOk;
if ((errCode==OthelloLogic.OK)) internalBoard.changeTurn();
else if ((errCode==OthelloLogic.NG)) this.messageStr=mNg;
else if ((errCode==OthelloLogic.PASS)) {this.messageStr=mPass;flags[2]=true;}
else if ((errCode==OthelloLogic.NOTYOU)) this.messageStr=mNotYou;
}
private void black(int x,int y){
put(internalBoard.putBlack(x,y));
}
private void white(int x,int y){
put(internalBoard.putWhite(x,y));
}

/**
* Constructor for OthelloPanel.
*/
public OthelloPanel() {
super();
setBackground(green);
setMinimumSize(brdSize);
setPreferredSize(brdSize);
setMaximumSize(brdSize);
Toolkit toolkit=Toolkit.getDefaultToolkit();
NG =toolkit.getImage("ng.gif");
NOTYOU=toolkit.getImage("notyou.gif");
PASS =toolkit.getImage("pass.gif");
flags[0]=true;
flags[1]=true;
flags[2]=false;
// protected boolean[] flags=new boolean[3];
// blackPlacable,whitePlacable,stop for pass
addMouseListener(new MouseHandler());
internalBoard=new OthelloLogic();
internalBoard.initiateBoard();
}
public OthelloPanel(String brd) {
this();
setBoard(brd);
}

public String getBoard(){
return internalBoard.encodeBoard();
}
public void setBoard(String brd){
internalBoard.decodeBoard(brd);
}
private void drawBackScene(Graphics g){
g.setColor(Color.gray);
for(int i=0;i<9;i++){
g.fillRect(i*70,0,5,565);
g.fillRect(0,i*70,565,5);
}
g.setColor(midGray);
for(int i=0;i<9;i++){
g.fillRect(i*70+1,1,3,563);
g.fillRect(1,i*70+1,563,3);
}
g.setColor(Color.darkGray);
for(int i=0;i<9;i++){
g.fillRect(i*70+2,3,1,561);

[*]前 次[#]
▲[6]上に [8]最新レス [7]ピク一覧

名前:
Eメール:
コメント:

sage
IDを表示
画像を投稿(たぬピク)
現在地を晒す