contract BrokerManager is Ownable {

	struct InvestTerm {
		uint64 amount;
		uint16 userFee;
	}
	/** server address **/
	address public server;
	/** invesor fees **/
	mapping (uint32 => mapping (uint32 => InvestTerm)) public investTerms;

	modifier onlyServer() {require(msg.sender == server); _;}

	function setServerAddress(address _newServerAddress) external onlyOwner {
		server = _newServerAddress;
	}

	/**
     * Create investition 
     */
	function invest(uint32 _playerId, uint32 _investorId, uint64 _amount, uint16 _userFee) external onlyServer {
		require(_amount > 0 && _userFee > 0);
		investTerms[_investorId][_playerId] = InvestTerm(_amount, _userFee);
	}

	/**
     * Delete investition 
     */
	function deleteInvest(uint32 _playerId, uint32 _investorId) external onlyServer {
		delete investTerms[_investorId][_playerId];
	}
}
function invest(uint32 _playerId, uint32 _investorId, uint64 _amount, uint16 _userFee) external onlyServer {
	require(_amount > 0 && _userFee > 0);
	investTerms[_investorId][_playerId] = InvestTerm(_amount, _userFee);
}

/**
 * Create investition 
 */