public void setup(BattlefieldPositionManager positionManager) { this.positionManager = positionManager; updateAllUI(); messageBoxUI = Instantiate(messageBoxUIPrefab, baseCanvas.transform).GetComponent <MessageBoxScript>(); messageBoxUI.clear(); messageBoxUI.setVisible(false); //Likely not useful any more /* * battleMenuUI = Instantiate(battleMenuUIPrefab, baseCanvas.transform); * battleMenuUI.name = "Battle Menu"; * ((RectTransform)battleMenuUI.transform).anchorMin = new Vector2(0.55f, 0f); * ((RectTransform)battleMenuUI.transform).anchorMax = new Vector2(1f, 0.4f); * battleMenuUI.SetActive(false); */ }
public void setup(Pair <int, int> battlefieldSize, Team team1, Team team2) { this.battleUIManager = battleUIManager; this.positionManager = new BattlefieldPositionManager(battlefieldSize.getFirst(), battlefieldSize.getSecond()); this.battleUIManager.setup(positionManager); this.battleUIManager.setShowCreatureUi(true); this.watchers = new Watchers(); this.actionResolver = new BattleActionResolver(watchers.battleActionWatcher, battleUIManager); this.team1 = new BattleTeam(team1, Owner.PLAYER, watchers); this.team2 = new BattleTeam(team2, Owner.COMPUTER, watchers); BattleCreature testCreature1 = new BattleCreature(team1.getCreatures()[0], Owner.PLAYER, watchers); BattleCreature testCreature2 = new BattleCreature(team2.getCreatures()[0], Owner.COMPUTER, watchers); this.positionManager.place(testCreature1, new BattlefieldPosition(1, BattlefieldPosition.PositionType.PRIMARY, 0)); this.currentTurnPhase = 0; beginBattleLoop(); }