public void placePlayer(HexCell cell, int idx, bool active, UnitInfo.unitType type, bool human) { //cell.setColor(playerColors[idx]); UnitInfo info = new UnitInfo(); info.playerNo = idx; info.type = type; info.human = human; cell.SetInfoStart(info); cell.SetInfo(info); cell.SetActive(active); if (active) { cell.paintNeigbors(); } }
public void startGameButton() { BaseSaver.resetAll(); /* * Create the new player here */ UnitInfo.unitType[] choiceArr = new UnitInfo.unitType[] { UnitInfo.unitType.Knight, UnitInfo.unitType.Lancer, UnitInfo.unitType.Swordsman, }; GameInfo nGame = new GameInfo(); nGame.name = "General Reginald Longbottom"; nGame.movement = 3; nGame.fatigue = 0; nGame.rations = 50; nGame.reputation = 0; nGame.gold = 250; nGame.enemyRoster = new UnitInfo[armySize]; for (int i = 0; i < armySize; i++) { UnitInfo info = new UnitInfo(); info.playerNo = 0; if (i < 2) { info.type = UnitInfo.unitType.Monster; } else { info.type = choiceArr[Random.Range(0, 3)]; } info.human = true; nGame.enemyRoster [i] = info; } BaseSaver.putGame(nGame); BaseSaver.putLocation("StartScreen"); SceneManager.LoadScene("LocationScene"); }
/// <summary> /// Adds a shelf unit to the units going by its bottom left coordinate /// </summary> /// <param name="blx">Bottom left coordiante of shelf</param> /// <param name="bly">Bottom right coordinate of shelf</param> public static void addUnit(int blx, int bly, int myID, float xsize, float ysize, bool forward, UnitInfo.unitType type) { for (int x = 0; x < xsize; x++) { for (int y = 0; y < ysize; y++) { tiles[TileGrid.getKey(blx + x, bly + y)] = new UnitInfo(type, myID, x, y, forward); } } }