Esempio n. 1
0
 public override void IsClicked(Action <List <Screen> > addScreens, Action <List <Screen> > removeScreens)
 {
     if (Costs.PayUnitCosts(mUnitType, Players.Player))
     {
         GameState.Current.AddUnit(Players.Player, GameState.Current.VillagePosOffset(Players.Player), mUnitType);
     }
 }
Esempio n. 2
0
        protected bool AddUnits(UnitTypes unitType)
        {
            if (Costs.PayUnitCosts(unitType, mPlayerId))
            {
                GameState.Current.AddUnit(mPlayerId, GameState.Current.VillagePosOffset(mPlayerId), unitType);
                return(true);
            }

            return(false);
        }
Esempio n. 3
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));
 }
Esempio n. 4
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));
 }