Position.java :  » Game » android-skat » de » bolay » skat » Android Open Source

Android Open Source » Game » android skat 
android skat » de » bolay » skat » Position.java
package de.bolay.skat;

public enum Position {
  FORE_HAND, MIDDLE_HAND, BACK_HAND;

  public Position before() {
    switch (this) {
      case FORE_HAND: return BACK_HAND;
      case MIDDLE_HAND: return FORE_HAND;
      case BACK_HAND: return MIDDLE_HAND;
    }
    throw new IllegalStateException("Unknown position: " + this);
  }

  public Position after() {
    switch (this) {
      case FORE_HAND: return MIDDLE_HAND;
      case MIDDLE_HAND: return BACK_HAND;
      case BACK_HAND: return FORE_HAND;
    }
    throw new IllegalStateException("Unknown position: " + this);
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.