001package fr.aumgn.dac2.game.classic; 002 003import fr.aumgn.bukkitutils.geom.Vector2D; 004import fr.aumgn.bukkitutils.playerref.PlayerRef; 005import fr.aumgn.dac2.game.GamePlayer; 006import fr.aumgn.dac2.game.start.PlayerStartData; 007 008public class ClassicGamePlayer extends GamePlayer { 009 010 private int lives; 011 private Vector2D deathPosition; 012 013 public ClassicGamePlayer(PlayerRef playerId, PlayerStartData playerData) { 014 super(playerId, playerData); 015 this.lives = 0; 016 this.deathPosition = null; 017 } 018 019 public int getLives() { 020 return lives; 021 } 022 023 public Vector2D getDeathPosition() { 024 return deathPosition; 025 } 026 027 public void incrementLives() { 028 lives++; 029 } 030 031 public boolean isDead() { 032 return lives < 0; 033 } 034 035 public void onFail(Vector2D deathPosition) { 036 lives--; 037 if (isDead()) { 038 this.deathPosition = deathPosition; 039 } 040 } 041}