2 * Copyright 2009 (c) Florian Frankenberger (darkblue.de)
4 * This file is part of LEA.
6 * LEA is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU Lesser General Public License as published by the Free
8 * Software Foundation, either version 3 of the License, or (at your option) any
11 * LEA is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with LEA. If not, see <http://www.gnu.org/licenses/>.
22 * Representing an eyes deviation
24 * @author Florian Frankenberger
26 public enum Deviation {
37 int directionX, directionY;
38 Deviation(int directionX, int directionY) {
39 this.directionX = directionX;
40 this.directionY = directionY;
43 private boolean concurs(int directionX, int directionY) {
44 return (directionX == this.directionX && directionY == this.directionY);
48 public static Deviation getDirectionFor(int directionX, int directionY) {
49 for (Deviation direction: Deviation.values()) {
50 if (direction.concurs(directionX, directionY)) {