Example #1
0
 protected bool BuildWall(Vector2 position)
 {
     return(GameState.Current.IsValidBuildingPlace(mPlayerId,
                                                   position,
                                                   UnitTypes.Wall,
                                                   0f) &&
            Costs.HasEnoughResourcesForUnit(UnitTypes.Wall, mPlayerId) &&
            Costs.PayUnitCosts(UnitTypes.Wall, mPlayerId) && GameState.Current.AddBuilding(
                mPlayerId,
                position,
                UnitTypes.Wall));
 }
Example #2
0
 protected bool BuildGate(Vector2 position, float rotation)
 {
     return(GameState.Current.IsValidBuildingPlace(mPlayerId,
                                                   position,
                                                   UnitTypes.Gate,
                                                   rotation) &&
            Costs.HasEnoughResourcesForUnit(UnitTypes.Gate, mPlayerId) &&
            Costs.PayUnitCosts(UnitTypes.Gate, mPlayerId) && GameState.Current.AddBuilding(
                mPlayerId,
                position,
                UnitTypes.Gate,
                rotation));
 }