Skip to content

Method: getMaximumNumberOfPlayers()

1: /*
2: * Copyright © 2020-2023 Fachhochschule für die Wirtschaft (FHDW) Hannover
3: *
4: * This file is part of gaming-core.
5: *
6: * Gaming-core 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: * Gaming-core 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: * gaming-core. If not, see <http://www.gnu.org/licenses/>.
18: */
19: package de.fhdw.gaming.core.domain.util;
20:
21: import java.util.List;
22:
23: import de.fhdw.gaming.core.domain.GameBuilder;
24: import de.fhdw.gaming.core.domain.GameBuilderFactory;
25: import de.fhdw.gaming.core.domain.GameException;
26: import de.fhdw.gaming.core.domain.Strategy;
27: import de.fhdw.gaming.core.ui.InputProvider;
28:
29: /**
30: * Wraps a {@link GameBuilderFactory} and supplies a suitable {@link Object#toString()} method.
31: */
32: public final class GameBuilderFactoryWrapper implements GameBuilderFactory {
33:
34: /**
35: * The wrapped game factory.
36: */
37: private final GameBuilderFactory wrappedFactory;
38:
39: /**
40: * Creates a {@link GameBuilderFactoryWrapper}.
41: *
42: * @param wrappedFactory The wrapped game factory
43: */
44: public GameBuilderFactoryWrapper(final GameBuilderFactory wrappedFactory) {
45: this.wrappedFactory = wrappedFactory;
46: }
47:
48: @Override
49: public String getName() {
50: return this.wrappedFactory.getName();
51: }
52:
53: @Override
54: public int getMinimumNumberOfPlayers() {
55: return this.wrappedFactory.getMinimumNumberOfPlayers();
56: }
57:
58: @Override
59: public int getMaximumNumberOfPlayers() {
60: return this.wrappedFactory.getMaximumNumberOfPlayers();
61: }
62:
63: @Override
64: public List<? extends Strategy<?, ?, ?>> getStrategies() {
65: return this.wrappedFactory.getStrategies();
66: }
67:
68: @Override
69: public GameBuilder createGameBuilder(final InputProvider inputProvider) throws GameException {
70: return this.wrappedFactory.createGameBuilder(inputProvider);
71: }
72:
73: @Override
74: public String toString() {
75: return this.getName();
76: }
77: }