Skip to content
Snippets Groups Projects
Select Git revision
  • main default protected
  • melissa
  • yanis
  • variant
4 results

Virus.java

Blame
  • Forked from COUETOUX Basile / FirefighterStarter
    83 commits ahead of the upstream repository.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Virus.java 1.10 KiB
    package model.virus;
    
    import java.util.List;
    
    import javafx.scene.paint.Color;
    import model.Board;
    import model.Entity;
    import model.Square;
    import util.Position;
    
    public class Virus implements Entity{
    
        private Position position;
        private final Color VIEW_COLOR = Color.LIMEGREEN;
        private int age;
        private final int PRIORITY = 1;
        public Virus(Position position){
            this.position = position;
            this.age = 0;
        }
        @Override
        public List<Position> nextTurn(Board<Square> board) {
            return List.of();
        }
    
        @Override
        public Position getPosition() {
            return this.position;
        }
    
        @Override
        public void setPosition(Position p) {
            this.position = p;
        }
    
        @Override
        public int getAge() {
            return age;
        }
    
        @Override
        public void setAge(int age) {
            this.age = age;
        }
    
        @Override
        public void incrementAge() {
            this.age = age + 1;
        }
    
        @Override
        public Color getViewColor() {
            return this.VIEW_COLOR;
        }
    
        @Override
        public int getPriority() {
            return this.PRIORITY;
        }
        
    }