
jadex.bdi.examples.blackjack.GameState Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-bdi Show documentation
Show all versions of jadex-applications-bdi Show documentation
The Jadex BDI applications package contain
several example applications, benchmarks and
testcases using BDI agents.
The newest version!
/*
* GameState.java
*
* Generated by Protege plugin Beanynizer.
* Changes will be lost!
*/
package jadex.bdi.examples.blackjack;
import jadex.commons.SimplePropertyChangeSupport;
import jadex.commons.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.List;
/**
* Java class for concept GameState of blackjack_beans ontology.
*/
public class GameState implements jadex.commons.beans.BeanInfo
{
//-------- constants ----------
//-------- attributes ----------
/** Attribute for slot dealer.*/
protected Player dealer;
/** Attribute for slot players. */
protected List players;
/** The helper object for bean events. */
public SimplePropertyChangeSupport pcs;
//-------- constructors --------
/**
* Default Constructor.
* Create a new GameState
.
*/
public GameState()
{
this(null, null);
}
/**
* Default Constructor.
* Create a new GameState
.
*/
public GameState(Player dealer, Player[] players)
{
this.players = new ArrayList();
this.pcs = new SimplePropertyChangeSupport(this);
if(dealer!=null)
setDealer(dealer);
if(players!=null && players.length>0)
setPlayers(players);
}
//-------- accessor methods --------
/**
* Get the dealer of this GameState.
* @return dealer
*/
public Player getDealer()
{
return this.dealer;
}
/**
* Set the dealer of this GameState.
* @param dealer the value to be set
*/
public void setDealer(Player dealer)
{
this.dealer = dealer;
pcs.firePropertyChange("dealer", null, dealer);
}
/**
* Update the dealer of this GameState.
* @param dealer the value to be set
*/
public void updateDealer(Player dealer)
{
this.dealer.setAccount(dealer.getAccount());
this.dealer.setCards(dealer.getCards());
this.dealer.setColorValue(dealer.getColorValue());
this.dealer.setStrategyName(dealer.getStrategyName());
this.dealer.setState(dealer.getState());
pcs.firePropertyChange("dealer", null, dealer);
}
/**
* Get the players of this GameState.
* @return players
*/
public Player[] getPlayers()
{
return (Player[])players.toArray(new Player[players.size()]);
}
/**
* Set the players of this GameState.
* @param players the value to be set
*/
public void setPlayers(Player[] players)
{
this.players.clear();
for(int i = 0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy