IEnumerator DoUpdateCell(float delayTime) { yield return(new WaitForSeconds(delayTime)); string spritePath = _unitType.ToString() + _bombType.ToString() + _unitColor.ToString(); Sprite newSprite = Resources.Load("Sprite/Cells/" + spritePath, typeof(Sprite)) as Sprite; GetComponent <SpriteRenderer>().sprite = newSprite; }
//Checks whether either queen of certain color is surrounded public bool IsQueenSurrounded(UnitColor color) { bool queenSurrounded = false; Debug.Log("Checking for Queen: " + color.ToString()); foreach (HexCoord hex in occupiedList) { if (colorDict[hex] == color && typeDict[hex] == UnitType.Queen) { int neighborCount = CountOccupiedNeighbors(hex); Debug.Log("Queen neighbors: " + neighborCount); if (neighborCount == 6) { queenSurrounded = true; } break; } } return(queenSurrounded); }
//Checks whether either queen of certain color is surrounded public bool IsQueenSurrounded(UnitColor color) { bool queenSurrounded = false; Debug.Log("Checking for Queen: " + color.ToString()); foreach (HexCoord hex in occupiedList) { if (colorDict[hex] == color && typeDict[hex] == UnitType.Queen) { int neighborCount = CountOccupiedNeighbors(hex); Debug.Log("Queen neighbors: " + neighborCount); if (neighborCount == 6) { queenSurrounded = true; } break; } } return queenSurrounded; }