// Use this for initialization void Start() { drawer = goDrawer.GetComponentInChildren <GEDrawerBasic>(); ui = goUI.GetComponentInChildren <GEUIBasic>(); game = new GoEsqueBasic(drawer, ui); ui.game = game; drawer.DrawInit(game); }
public StoneBasic(Intersection _intersection, GoEsque _game) { intersection = _intersection; liberties = intersection.neighbors.Count - Pos.EdgeCount(intersection.pos, _game.dims); Stone stone = this; _game.stones[intersection] = stone; _game.intersections[intersection.pos.gridLoc.key()].occupant = stone; game = _game; player = game.currentPlayer; }
public void DrawInit(GoEsque _game) { game = _game; stones = new Dictionary <Stone, GameObject>(); intersections = new Dictionary <Intersection, GameObject>(); Draw(); Loc MidLoc = new Loc(Mathf.Ceil(game.dims[0] / 2) - 1, Mathf.Ceil(game.dims[1] / 2) - 1); // Debug.Log(MidLoc.key()); Vector3 p = intersections[game.intersections[MidLoc.key()]].transform.position; if (game.tileShape == TileShape.SQUARE) { Camera.main.transform.position = new Vector3(p.x, 10, p.z); Camera.main.orthographicSize = game.dims[0] / 1.75f; } else { Camera.main.transform.position = new Vector3(p.x * 3 / 2, 10, p.z * 3 / 2); Camera.main.orthographicSize = (3 / 2) * game.dims[0] / 1.75f; } }