码迷,mamicode.com
首页 > 其他好文 > 详细

amazon 设计 11 chess

时间:2014-08-14 08:11:38      阅读:301      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   os   io   for   ar   div   

1 public class ChessPieceTurn { };
2 public class GameManager {
3 void processTurn(PlayerBase player) { };
4 boolean acceptTurn(ChessPieceTurn turn) { return true; };
5 Position currentPosition;
6 }
7
8 public abstract class PlayerBase {
9 public abstract ChessPieceTurn getTurn(Position p);
10 }
11 class ComputerPlayer extends PlayerBase {
12 public ChessPieceTurn getTurn(Position p) { return null; }
13 public void setDifficulty() { };
14 public PositionEstimator estimater;
15 public PositionBackTracker backtracter;
16 }
17 public class HumanPlayer extends PlayerBase {
18 public ChessPieceTurn getTurn(Position p) { return null; }
19 }
20
21 public abstract class ChessPieceBase {
22 abstract boolean canBeChecked();
23 abstract boolean isSupportCastle();
24 }
25 public class King extends ChessPieceBase { ... }
26 public class Queen extends ChessPieceBase { ... }
27
28 public class Position { // represents chess positions in compact form
29 ArrayList<ChessPieceBase> black;
30 ArrayList<ChessPieceBase> white;
31 }
32
33 public class PositionBackTracker {
34 public static Position getNext(Position p) { return null; }
35 }
36 public class PositionEstimator {
37 public static PositionPotentialValue estimate(Position p) { ... }
38 }
39 public abstract class PositionPotentialValue {
40 abstract boolean lessThan(PositionPotentialValue pv);
41 }

 

amazon 设计 11 chess,布布扣,bubuko.com

amazon 设计 11 chess

标签:style   blog   color   os   io   for   ar   div   

原文地址:http://www.cnblogs.com/leetcode/p/3911604.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!