Skip to content

Package: ShiftList

ShiftList

Coverage

1: package de.fhdw.gaming.memory;
2:
3: import java.util.List;
4: import java.util.Optional;
5:
6: import de.fhdw.gaming.core.domain.Move;
7: import de.fhdw.gaming.memory.impl.MemorySaveEntryImpl;
8:
9: /**
10: * Organises a list of Optinal doubles, allowing to set a maximum size for is.
11: */
12: public interface ShiftList {
13:
14: /**
15: * Returns the list of all recorded outcomes as Optional<Double>.
16: */
17: List<MemorySaveEntryImpl> show();
18:
19: /**
20: * Determines how many outcomes can be saved in the list displyyed by the show() method.
21: * If there are too many outcomes saved this will delete the oldest outcome until
22: * the number of outcomes is equal to the length.
23: * @param length
24: */
25: void setLength(int length);
26:
27: /**
28: * Returns the number of outcomes that can be saves.
29: */
30: int getLength();
31:
32: /**
33: * Adds an outcome as Optional<Double> to the list. If the list is already full,
34: * the oldest outcome will be deleted before adding the new one.
35: * @param input
36: */
37: void push(Optional<Double> input);
38:
39: /**
40: * Adds an outcome as Optional<Double> to the list. If the list is already full,
41: * the oldest outcome will be deleted before adding the new one.
42: * @param lastMoveUsed
43: */
44: void rememberMyMove(Move<?, ?> lastMoveUsed);
45:
46: /**
47: * Adds an outcome as Optional<Double> to the list. If the list is already full,
48: * the oldest outcome will be deleted before adding the new one.
49: * @param lastMoveUsed
50: */
51: void rememberOpponentMove(Move<?, ?> lastMoveUsed);
52:
53: }