diff --git a/src/main/java/com/fossgalaxy/games/fireworks/FunPlayer.java b/src/main/java/com/fossgalaxy/games/fireworks/FunPlayer.java new file mode 100644 index 0000000000000000000000000000000000000000..62c309b1930583cb0e9c51fd3985ab9384bf2d7d --- /dev/null +++ b/src/main/java/com/fossgalaxy/games/fireworks/FunPlayer.java @@ -0,0 +1,36 @@ +package com.fossgalaxy.games.fireworks; + +import com.fossgalaxy.games.fireworks.ai.Agent; +import com.fossgalaxy.games.fireworks.ai.osawa.rules.OsawaDiscard; +import com.fossgalaxy.games.fireworks.ai.rule.DiscardOldestFirst; +import com.fossgalaxy.games.fireworks.ai.rule.PlaySafeCard; +import com.fossgalaxy.games.fireworks.ai.rule.ProductionRuleAgent; +import com.fossgalaxy.games.fireworks.ai.rule.TellAnyoneAboutUsefulCard; +import com.fossgalaxy.games.fireworks.ai.rule.random.TellRandomly; +import com.fossgalaxy.games.fireworks.ai.rule.simple.PlayIfCertain; +import com.fossgalaxy.games.fireworks.ai.rule.wrapper.IfRule; +import com.fossgalaxy.games.fireworks.annotations.AgentBuilderStatic; + +/** + * Created by piers on 25/04/17. + */ +public class FunPlayer { + + @AgentBuilderStatic("fun") + public static Agent createFunPlayer(){ + ProductionRuleAgent pra = new ProductionRuleAgent(); + pra.addRule(new PlayIfCertain()); + pra.addRule(new PlaySafeCard()); + // Try to leave an information point for the player + pra.addRule( + new IfRule( + (id, state) -> state.getInfomation() > 1, + new TellAnyoneAboutUsefulCard()) + ); + pra.addRule(new OsawaDiscard()); + + pra.addRule(new DiscardOldestFirst()); + pra.addRule(new TellRandomly()); + return pra; + } +}