Skip to content
Snippets Groups Projects
CellLens.java 364 B
Newer Older
  • Learn to ignore specific revisions
  • Guyslain's avatar
    Guyslain committed
    package model;
    
    import datastruct.Lens;
    
    public class CellLens<S extends State<S>> implements Lens<S> {
    
        private final Cell<S> cell;
    
        public CellLens(Cell<S> cell) {
            this.cell = cell;
        }
    
        @Override
        public S get() {
            return cell.getState();
        }
    
        @Override
        public void set(S value) {
            cell.setState(value);
        }
    }