Skip to content
Snippets Groups Projects
Select Git revision
  • 6244c0d9cd6da5cc174eb70a92d92500c57d216c
  • master default protected
  • dev-moodle-4
  • hsh_v4.1.2
  • hsh_v4.1.1
  • hsh_v4.1.0
6 results

jmodule.js

Blame
  • Lexicon.java 898 B
    package approach3.misc;
    
    import structs.Int3;
    
    import java.awt.*;
    import java.util.HashMap;
    
    public class Lexicon {
    
        private HashMap<Point, String> directionOrientation
                = new HashMap<>() {
            {
                put(new Point(+1, 0), "Osten");
                put(new Point(-1, 0), "Westen");
                put(new Point(0, -1), "Norden");
                put(new Point(0, +1), "Süden");
    
                put(new Point(+1, -1), "Nord-Osten");
                put(new Point(-1, -1), "Nord-Westen");
    
                put(new Point(+1, +1), "Süd-Osten");
                put(new Point(-1, +1), "Süd-Westen");
            }
        };
    
        private static Lexicon lexicon;
    
        public static Lexicon getInstance() {
            if (lexicon == null)
                lexicon = new Lexicon();
    
            return lexicon;
        }
    
        public String getText(Point direction) {
            return directionOrientation.get(direction);
        }
    }