Skip to content

Package: VierConnectsBoardEventProvider

VierConnectsBoardEventProvider

Coverage

1: /*
2: * Copyright © 2021-2023 Fachhochschule für die Wirtschaft (FHDW) Hannover
3: *
4: * This file is part of ipspiel24-VierConnects-gui.
5: *
6: * ipspiel24-VierConnects-gui is free software: you can redistribute it and/or modify it under
7: * the terms of the GNU General Public License as published by the Free Software
8: * Foundation, either version 3 of the License, or (at your option) any later
9: * version.
10: *
11: * ipspiel24-VierConnects-gui is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14: * details.
15: *
16: * You should have received a copy of the GNU General Public License along with
17: * ipspiel24-VierConnects-gui. If not, see <http://www.gnu.org/licenses/>.
18: */
19: package de.fhdw.gaming.ipspiel24.VierConnects.gui;
20:
21: import de.fhdw.gaming.ipspiel24.VierConnects.core.domain.VierConnectsPlayer;
22: import de.fhdw.gaming.ipspiel24.VierConnects.core.domain.VierConnectsState;
23: import de.fhdw.gaming.ipspiel24.VierConnects.gui.event.VierConnectsBoardEvent;
24:
25: /**
26: * Provides input from the user interacting with a Vier Connects board.
27: */
28: public interface VierConnectsBoardEventProvider {
29:
30: /**
31: * Waits for a user event and returns it.
32: *
33: * @param player It is this player's turn.
34: * @param state A copy of the game state.
35: * @return The {@link VierConnectsBoardEvent} generated by the user.
36: */
37: VierConnectsBoardEvent waitForEvent(VierConnectsPlayer player, VierConnectsState state);
38:
39: /**
40: * If the provider is currently waiting for a user event, the wait operation will be cancelled.
41: */
42: void cancelWaiting();
43: }