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); } }
protected bool AddUnits(UnitTypes unitType) { if (Costs.PayUnitCosts(unitType, mPlayerId)) { GameState.Current.AddUnit(mPlayerId, GameState.Current.VillagePosOffset(mPlayerId), unitType); return(true); } return(false); }
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)); }
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)); }