Skip to content
Snippets Groups Projects
Extinguisher.java 898 B
Newer Older
  • Learn to ignore specific revisions
  • package model;
    
    import util.Position;
    
    import java.util.List;
    
    public abstract class Extinguisher implements Element{
    
        protected Position position;
        protected ModelElement element;
        public Extinguisher(Position position){
            this.position = position;
        }
    
        public Position getPosition() {
            return position;
        }
    
        public void setPosition(Position position) {
            this.position = position;
    
        }
        @Override
        public boolean contains(List<Position> positions) {
            return positions.contains(this.getPosition());
        }
    
    
    
        public ModelElement getElement(){
            return this.element;
        }
    
        public void extinguish(Board board,Position position) {
            if (board.getFires().containsKey(position)) {
                board.getFires().remove(position);
            }
    
        }
    
    
        public abstract List<Position> update(FirefighterBoard firefighterBoard);
    
    }