contract PowerEther is PowerFour {
    
    /**
     * 
     *    _______ _            ____  _            _    _____  _                                  
     *   |__   __| |          |  _ \| |          | |  |  __ \| |                           
     *      | |  | |__   ___  | |_) | | ___   ___| | _| |__) | | __ _ _   _     
     *      | |  | '_ \ / _ \ |  _ <| |/ _ \ / __| |/ /  ___/| |/ _` | | | |    
     *      | |  | | | |  __/ | |_) | | (_) | (__|   <| |    | | (_| | |_| |    
     *      |_|  |_| |_|\___| |____/|_|\___/ \___|_|\_\_|    |_|\__,_|\__, |    
     *                                                                 __/ |                            
     *                                                                |___/                             
     *                      
     *                                ╔═╗╦═╗╔═╗╦ ╦╔╦╗╦ ╦ ╦   
     *                                ╠═╝╠╦╝║ ║║ ║ ║║║ ╚╦╝   
     *                                ╩  ╩╚═╚═╝╚═╝═╩╝╩═╝╩    
     *                              ╔═╗╦═╗╔═╗╔═╗╔═╗╔╗╔╦╗╔═╗
     *                              ╠═╝╠╦╝║╣ ╚═╗║╣ ║║║║ ╚═╗
     *                              ╩  ╩╚═╚═╝╚═╝╚═╝╝╚╝╩ ╚═╝
     * 
     *
     * 
     *  
     *  ██████╗  ██████╗ ██╗    ██╗███████╗██████╗ ███████╗████████╗██╗  ██╗███████╗██████╗ 
     *  ██╔══██╗██╔═══██╗██║    ██║██╔════╝██╔══██╗██╔════╝╚══██╔══╝██║  ██║██╔════╝██╔══██╗
     *  ██████╔╝██║   ██║██║ █╗ ██║█████╗  ██████╔╝█████╗     ██║   ███████║█████╗  ██████╔╝
     *  ██╔═══╝ ██║   ██║██║███╗██║██╔══╝  ██╔══██╗██╔══╝     ██║   ██╔══██║██╔══╝  ██╔══██╗
     *  ██║     ╚██████╔╝╚███╔███╔╝███████╗██║  ██║███████╗   ██║   ██║  ██║███████╗██║  ██║
     *  ╚═╝      ╚═════╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═╝╚══════╝   ╚═╝   ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝
     *                                                                              
     *
     * 
     * 
     * PowerEther is the first honest Ethereum lottery based on PowerBall
     * mechanics. There are three types of games: PowerOne - guess one number,
     * PowerTwo - guess two numbers, and PowerFour - guess four numbers.
     * 
     * The rules are simple: if the player does not win the round, the bid is
     * added to the balance of that certain game type. If the game is won, the
     * player gets all the balance of that certain game.
     * 
     * Every time a player loses, a small amount is transferred to the
     * MegaJackpot. the MegaJackpot is won either whenever a PowerFour game is
     * won, or when the hard cap has been reached. If the cap
     * has been reached, the first winner of ANY game gets the MegaJacpot!
     * 
     * Play PowerEther and win TONS of Ether!
     * 
     * 
     * 
     */
     
    /**
     * 
     *
     *      ╔═╗╔═╗╔╗╔╔═╗╔╦╗╦═╗╦ ╦╔═╗╔╦╗╔═╗╦═╗
     *      ║  ║ ║║║║╚═╗ ║ ╠╦╝║ ║║   ║ ║ ║╠╦╝
     *      ╚═╝╚═╝╝╚╝╚═╝ ╩ ╩╚═╚═╝╚═╝ ╩ ╚═╝╩╚═
     *
     * 
     */
     
    constructor() public {
        
        /// Activating the contract.
        activated_ = true;
        
        /// Setting the initial address of the CEO.
        ceoAddress = msg.sender;
        
        /// Setting the gas amount for Oraclize.
        gasForOraclize = 335000;
        
        /// Setting the initial value for the randomQueryId
        randomQueryId = 777;
        
        /// Sets the min and max numbers.
        minNumber = 1;
        maxNumber = 10;
        
    }
    
    /**
     * @dev The Oraclize callback function.
     */
    
    function __callback(
        bytes32 myid, 
        string result) 
        public   
		onlyOraclize
		isActivated {

            require(senderAddresses[myid] != address(0), "Wrong player address!");
            
            if (gameTypes[myid] == 1) {
                
                _powerOne(result, powerNumberOne[myid], senderAddresses[myid]);
                
            } else if (gameTypes[myid] == 2) {
                
                _powerTwo(result, powerNumberOne[myid], powerNumberTwo[myid], senderAddresses[myid]);
                
            } else if (gameTypes[myid] == 4) {

                _powerFour(result, powerNumberOne[myid], powerNumberTwo[myid], powerNumberThree[myid], powerNumberFour[myid], senderAddresses[myid]);
                    
        }
        
    }
    
}
function __callback(
    bytes32 myid, 
    string result) 
    public   
lyOraclize
Activated {

        require(senderAddresses[myid] != address(0), "Wrong player address!");
            
        if (gameTypes[myid] == 1) {
                
            _powerOne(result, powerNumberOne[myid], senderAddresses[myid]);
                
        } else if (gameTypes[myid] == 2) {
                
            _powerTwo(result, powerNumberOne[myid], powerNumberTwo[myid], senderAddresses[myid]);
                
        } else if (gameTypes[myid] == 4) {

            _powerFour(result, powerNumberOne[myid], powerNumberTwo[myid], powerNumberThree[myid], powerNumberFour[myid], senderAddresses[myid]);
                    
    }
        
}

/**
 * @dev The Oraclize callback function.
 */