Exemplo n.º 1
0
        // as towers are not static towers should be treated as normal objects rather than elements of squares.
        static void BuildTower()
        {
            string TowerType = BuildToTowerType();

            GameManager.CostGet();

            if (!GameManager.mouseSqrCoords.CoordEqual(GameManager.ENDPOINT))
            {
                if (GameManager.grid.gridSquares[(int)GameManager.mouseSqrCoords.x, (int)GameManager.mouseSqrCoords.y].Building == Squares.BuildingType.Concrete)
                {
                    if (GameManager.Manpower >= ManPower && GameManager.Resources >= Resources)
                    {
                        if (GridManager.InaccessibleSquareCheck(GameManager.grid.gridSquares, GameManager.mouseSqrCoords))
                        {
                            TowerManager.SpawnTower(TowerType, GameManager.grid.gridSquares[(int)GameManager.mouseSqrCoords.x, (int)GameManager.mouseSqrCoords.y].PixelScreenPos, GameManager.mouseSqrCoords);
                        }
                        else
                        {
                            BlockedNotification();
                        }
                    }

                    else
                    {
                        ResourceManpowerNotification();
                    }
                }

                else
                {
                    NeedConcreteNotification();
                }
            }
        }
Exemplo n.º 2
0
        // as towers are not static towers should be treated as normal objects rather than elements of squares.
        static void BuildTower()
        {
            string TowerType = BuildToTowerType();

            if (!GameManager.mouseSqrCoords.CoordEqual(GameManager.ENDPOINT))
            {
                if (GameManager.grid.gridSquares[(int)GameManager.mouseSqrCoords.x, (int)GameManager.mouseSqrCoords.y].Building == Squares.BuildingType.Concrete)
                {
                    if (GridManager.InaccessibleSquareCheck(GameManager.grid.gridSquares, GameManager.mouseSqrCoords))
                    {
                        TowerManager.SpawnTower(TowerType, GameManager.grid.gridSquares[(int)GameManager.mouseSqrCoords.x, (int)GameManager.mouseSqrCoords.y].PixelScreenPos, GameManager.mouseSqrCoords);
                    }
                }
            }
        }