public QueenAlgo(int numberOfQueens, QueenScript qs) { qScript = qs; nQueens = numberOfQueens; queensPositions = new int[numberOfQueens]; currentQpos = new int[numberOfQueens]; isBlue = new bool[numberOfQueens]; rows = new int[numberOfQueens]; diag1 = new int[2 * numberOfQueens - 1]; diag2 = new int[2 * numberOfQueens - 1]; for (int i = 0; i < numberOfQueens; ++i) { currentQpos[i] = -1; queensPositions[i] = -1; rows[i] = 0; isBlue [i] = true; } for (int i = 0; i < 2 * numberOfQueens - 1; ++i) { diag1[i] = 0; diag2[i] = 0; } stk = new Stack <int>(); stk.Push(-1); }
private void Start() { queen = FindObjectOfType <QueenScript>(); startHealth = queen.startHealth; health = startHealth; }