Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
1.1 kB
2
Indexable
Never
package com.comp301.a02adventure;

import java.util.List;

public class GameImpl implements Game {

  private final Map map;
  private final Player player;

  public GameImpl(Map map, Player player) throws IllegalArgumentException {
    this.map = map;
    if (this.map == null) {
      throw new IllegalArgumentException("Map is null");
    }
    this.player = player;
    if (this.player == null) {
      throw new IllegalArgumentException("Player is null");
    }
  }

  @Override
  public Position getPlayerPosition() {
    return player.getPosition();
  }

  @Override
  public String getPlayerName() {
    return player.getName();
  }

  @Override
  public List<Item> getPlayerItems() {
    return player.getInventory().getItems();
  }

  @Override
  public boolean getIsWinner() {
    return false;
  }

  @Override
  public void printCellInfo() {}

  @Override
  public void openChest() {}

  @Override
  public boolean canMove(Direction direction) {
    return false;
  }

  @Override
  public void move(Direction direction) {}
}