示例#1
0
    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;
    }
示例#2
0
    //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);
    }
示例#3
0
 //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;
 }