DealerFrame.java

本文深入探讨了游戏开发领域的关键技术,包括游戏引擎、编程语言、硬件优化等,并重点介绍了AI音视频处理在游戏开发中的应用,如语义识别、语音识别、AR特效等,为游戏开发者提供了一站式的解决方案和技术指南。
部署运行你感兴趣的模型镜像
package jadex.examples.blackjack.dealer;

import jadex.examples.blackjack.*;
import jadex.examples.blackjack.gui.*;
import jadex.runtime.AgentEvent;
import jadex.runtime.IAgentListener;
import jadex.runtime.IExternalAccess;
import jadex.util.*;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

import javax.swing.*;

/**
* This GUI gives an overview of the ongoings during the game.
* It shows different panels representing the 'internal states'
* (the cards, accounts and bets) of the dealer- and all the
* player-agents as well as one special panel containing a
* progressBar and a few buttons (the 'OptionPanel').
* But this class is not just a viewing-component, but also an
* agent-plan and therefor it contains some jadex-specific code,
* which is perhaps worth looking at.
*/
public class DealerFrame extends GameStateFrame
{
//-------- attributes --------

/** The agent access object. */
protected IExternalAccess agent;

/** child windows (e.g. statistics). */
protected Set children;

//-------- constructors --------

/**
* Creates a new instance of the dealer frame.
* Here, the GUI is build up for the first time, all
* panels are instantiated and shown on the screen.
*/
public DealerFrame(final Dealer me, final IExternalAccess agent)
{
super(null, null);
this.agent = agent;
this.children = new HashSet();

// Show Jadex version information.
String title = "Blackjack Dealer";
//+ Configuration.getConfiguration().getReleaseNumber()
//+ " (" + Configuration.getConfiguration().getReleaseDate() + ")";

//Create the 'Main'-Window and the contentPane
setTitle(title);
//setResizable(false);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
DealerFrame.this.agent.killAgent();
}
});
agent.addAgentListener(new IAgentListener()
{
public void agentTerminating(AgentEvent ae)
{
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
DealerFrame.this.dispose();
}
});
}
}, false);

// set the icon to be displayed for the frame
setIconImage(GUIImageLoader.getImage("heart_small_d").getImage());

SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
DealerFrame.this.setGameState((GameState)agent.getBeliefbase().getBelief("gamestate").getFact());
}
});
setControlPanel(new DealerOptionPanel(agent, DealerFrame.this));

/*getContentPane().setLayout(new GridLayout(0, 2));

// initialise the JPanels for the Dealer and the progressBar
PlayerPanel dealerPanel = new PlayerPanel(me);

// add these JPanels as the first-row to the contentPane
getContentPane().add(dealerPanel);
getContentPane().add(new DealerOptionPanel(agent, DealerFrame.this));*/

// display the gui on the screen
pack();
setLocation(SGUI.calculateMiddlePosition(DealerFrame.this));
setVisible(true);
}

/**
* Add a child window to be disposed on exit.
*/
public void addChildWindow(Window child)
{
children.add(child);
}

/**
* Remove a child window to be disposed on exit.
*/
public void removeChildWindow(Window child)
{
children.remove(child);
}

/**
* Dispose this window and child windows.
*/
public void dispose()
{
super.dispose();

for(Iterator i=children.iterator(); i.hasNext(); )
((Window)i.next()).dispose();
}
}

您可能感兴趣的与本文相关的镜像

Stable-Diffusion-3.5

Stable-Diffusion-3.5

图片生成
Stable-Diffusion

Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值