Skip to content
Snippets Groups Projects
Select Git revision
  • 61666a1b81fdd4b088ee49959aed2b0c4d6e36ef
  • main default protected
  • doug/element-x-links
  • dependabot/npm_and_yarn/rollup-2.79.2
  • dependabot/npm_and_yarn/rollup-3.29.5
  • dependabot/npm_and_yarn/serve-static-1.16.0
  • update-dco
  • deploy
  • cf_pages_headers
  • gsouquet/copy-to-clipboard
  • lgian/test_deployment
  • use-json-for-clients-data
  • t3chguy-patch-1
  • url-escape-fragment
  • twily/trustFedoraEweb
  • danilafe/open-matrix-link
  • bwindels/fix-parse-identifier
  • danilafe/invalid-url
  • danilafe/slash-username-fix
  • danilafe/legal-disclaimer
  • danilafe/policy-links
  • 1.2.17
  • 1.2.16
  • 1.2.15
  • 1.2.14
  • 1.2.13
  • 1.2.12
  • 1.2.11
  • 1.2.10
  • 1.2.9
  • 1.2.8
  • 1.2.7
  • 1.2.6
  • 1.2.5
  • 1.2.4
  • 1.2.3
  • 1.2.2
  • 1.2.1
  • 1.2.0
  • 1
  • 1.1.3
41 results

App.scss

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Lab03Game.java 2.86 KiB
    package de.hda.fbi.db2.api;
    
    import java.util.List;
    
    /**
     * API Class for lab03
     * Created by l.koehler on 05.08.2019.
     */
    public abstract class Lab03Game {
    
        public void init() {}
    
        /**
         * You can use the data from lab01, this variable will be automatically set.
         */
        protected Lab01Data lab01Data;
    
        /**
         * You can use the EntityManager or other stuff from lab02,
         * this variable will be automatically set.
         */
        protected Lab02EntityManager lab02EntityManager;
    
        /**
         * Setter for Lab01Data.
         *
         * @param lab01Data lab01Data
         */
        public void setLab01Data(Lab01Data lab01Data) {
            this.lab01Data = lab01Data;
        }
    
        /**
         * Setter fro Lab02EntityManager.
         *
         * @param lab02EntityManager lab02EntityManager
         */
        public void setLab02EntityManager(Lab02EntityManager lab02EntityManager) {
            this.lab02EntityManager = lab02EntityManager;
        }
    
        /**
         * This method should create a game. For this you have to do the following things:
         * - Ask for player
         * - Ask for categories
         * - Ask for maximum questions per category and choose questions
         * <p>
         * You do not have to play the game here. This should only create a game
         *
         * @return the game entity object. IMPORTANT: This has to be a entity.
         */
        public abstract Object createGame();
    
        /**
         * Here you have to play the game 'game'.
         *
         * @param game the game that should be played
         */
        public abstract void playGame(Object game);
    
        /**
         * This should create a game with the given arguments.
         * You do not have to read data from console.
         * The game should be create only with the given arguments.
         * You do not have to play the game here.
         *
         * @param playerName name of the player
         * @param questions  chosen questions
         * @return a game object
         */
        public abstract Object createGame(String playerName, List<Object> questions);
    
        /**
         * Simulate a game play. You do not have to read anything from console.
         *
         * @param game given game
         */
        public abstract void simulateGame(Object game);
    
        /**
         * This should return the appropriate player for the given game.
         *
         * @param game given game for returning player
         * @return player for given game
         */
        public abstract Object getPlayer(Object game);
    
        /**
         * Return the player entity with given name.
         *
         * @param name name of the player
         * @return the player entity
         */
        public abstract Object getPlayer(String name);
    
        /**
         * return the right answers of a played game.
         *
         * @param game given game
         * @return number of right answers
         */
        public abstract int getRightAnswers(Object game);
    
        /**
         * persist the game object in the database.
         * @param game given game
         */
        public abstract void persistGame(Object game);
    }