Skip to content

Method: HTStrategy(IHTMoveFactory)

1: package de.fhdw.gaming.ipspiel23.ht.strategy.impl;
2:
3: import de.fhdw.gaming.ipspiel23.ht.moves.factory.IHTMoveFactory;
4: import de.fhdw.gaming.ipspiel23.ht.strategy.IHTStrategy;
5:
6: /**
7: * Represents a Heads or Tails strategy.
8: */
9: public abstract class HTStrategy implements IHTStrategy {
10:
11: /**
12: * The move factory used by this strategy.
13: */
14: private final IHTMoveFactory moveFactory;
15:
16: /**
17: * Creates a new strategy.
18: *
19: * @param moveFactory the move factory used by this strategy
20: */
21: protected HTStrategy(final IHTMoveFactory moveFactory) {
22: this.moveFactory = moveFactory;
23: }
24:
25: /**
26: * Returns the move factory used by this strategy.
27: *
28: * @return the move factory used by this strategy
29: */
30: protected IHTMoveFactory getMoveFactory() {
31: return moveFactory;
32: }
33:
34: @Override
35: public String toString() {
36: return this.getClass().getSimpleName();
37: }
38: }