Class CommonInfluence
java.lang.Object
it.polimi.ingsw.eriantys.model.influence.CommonInfluence
- All Implemented Interfaces:
InfluenceCalculator
- Direct Known Subclasses:
BonusInfluence,ExcludeColorInfluence,NoTowersInfluence
This concrete implementation for the state design pattern involving
InfluenceCalculator
defines the influence calculation when it is not affected by any CharacterCard.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcalculate(Player player, IslandGroup island, Set<Color> ownedProfessors) The method evaluates the influence of aPlayeron a certain island.protected intevaluateColor(StudentContainer island, Color c) The method evaluates the quantity of students of aColoron an island.protected intevaluateTowers(IslandGroup island, Player player) The method evaluates the contribution of the towers on an island.
-
Constructor Details
-
CommonInfluence
public CommonInfluence()
-
-
Method Details
-
calculate
public int calculate(Player player, IslandGroup island, Set<Color> ownedProfessors) throws InvalidArgumentException Description copied from interface:InfluenceCalculatorThe method evaluates the influence of aPlayeron a certain island.- Specified by:
calculatein interfaceInfluenceCalculator- Parameters:
player- the main target of the calculationisland- the game location used for the calculationownedProfessors- theColor(s) of the professors which thePlayerowns- Returns:
- the influence value for the given
Playeron the specified island - Throws:
InvalidArgumentException- if one or more parameters are illegal
-
evaluateColor
The method evaluates the quantity of students of aColoron an island. -
evaluateTowers
The method evaluates the contribution of the towers on an island.
-