Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     instance_ = this;
     board     = new Tile[rows_, columns_];
     FillCubeGrid();
     drawer = BoardDrawer.getInstance();
     drawer.init(rows_, columns_, cubePrefab);
 }
Exemplo n.º 2
0
    public void LinkBrain(BoardDrawer drawer, ChessGameHandler handler)
    {
        this.handler = handler;
        this.drawer  = drawer;

        if (name.Contains("random"))
        {
            PickAName();
        }
    }
Exemplo n.º 3
0
    void Start()
    {
        board = GetComponent <BoardDrawer> ();
        board.OnChangeCallBack += NextTurn;
        if (whitePlayer == null)
        {
            whitePlayer = new HumanCBrain();
            //whitePlayer = new AIBrain (board, this, TeamColor.white);
        }
        if (blackPlayer == null)
        {
            blackPlayer = new HumanCBrain();
            //blackPlayer = new SAIBrain (board, this, TeamColor.black);
        }
        whitePlayer.LinkBrain(board, this);
        blackPlayer.LinkBrain(board, this);
        player.Add(PlayerColor.white, whitePlayer);
        player.Add(PlayerColor.black, blackPlayer);

        NextTurn();
    }
Exemplo n.º 4
0
 public static void ClassInitialize(TestContext context)
 {
     testBoardDrawer = new BoardDrawer(testRenderer.Object);
 }
Exemplo n.º 5
0
 void Start()
 {
     boardDrawer     = GameObject.Find("GameBoard").GetComponent <BoardDrawer>();
     boardCalculator = GameObject.Find("GameBoard").GetComponent <BoardCalculator>();
 }
Exemplo n.º 6
0
 public TileHandler GetTileHandler(BoardDrawer drawer)
 {
     return(drawer.tiles[x, y]);
 }
Exemplo n.º 7
0
 public BoardDrawer()
 {
     instance_   = this;
     viewLabels_ = false;
 }
Exemplo n.º 8
0
 public void Initialize(BoardDrawer drawer, Transform holder, int x, int y, Vector2 tileOffset)
 {
     this.drawer             = drawer;
     transform.parent        = holder;
     transform.localPosition = new Vector2(offset.x + x * tileOffset.x, offset.y + y * tileOffset.y);
 }