net.sf.magicproject.zone
Class ZoneManager

java.lang.Object
  extended by net.sf.magicproject.zone.ZoneManager

public class ZoneManager
extends java.lang.Object

Since:
0.54.17
Author:
Fabrice Daugan

Field Summary
 java.util.List<ExpandableZone> additionalZones
          additional zones of this player
 DelayedBuffer delayedBuffer
          delayed buffer of this player (DBZ)
static ExpandableZone expandedZone
          This is the current expanded zone.
 Hand hand
          hand of this player
 Play play
          play zone of this player
static Side side
          shared side of players
static Stack stack
          shared stack of players
 TriggeredBuffer triggeredBuffer
          triggered buffer of this player (TBZ)
 
Constructor Summary
ZoneManager(int idPlayer, javax.swing.JScrollPane handSPanel, javax.swing.JScrollPane triggeredSPanel, javax.swing.JScrollPane delayedSPanel, javax.swing.JPanel additionalZonesPanel)
          Creates an ew instance of ZoneManager
 
Method Summary
 void checkAllCardsOf(Test test, java.util.List<Targetable> list, Ability ability)
          Checks all cards corresponding to this constraints
 int countAllCardsOf(Test test, Ability ability)
          Checks all cards corresponding to the specified constraints
 int countAllCardsOf(Test test, Ability ability, int limit, boolean canBePreempted)
          Checks all cards corresponding to the specified constraints.
 MZone getContainer(int idZone)
          return the container corresponding to the specified idZone
 java.util.List<MZone> getValidTargetZones()
          Return All available zones.
static java.lang.String getZoneName(int idZone)
          Return the zone name corresponding to the given zone id.
 void giveCards(Deck deck, java.io.FileInputStream dbFile)
          Fill the player's init zone with cards found in the given InputFile
static void init(javax.swing.JScrollPane sideSPanel, javax.swing.JScrollPane stackSPanel)
           
static void initTbs(java.io.InputStream inputStream)
           Structure of stream : Data[size] play sectors [ZoneSector[]] additional zones [ZoneConfiguration[]] default Zone id [int]
 void reset()
          Set the zone attribut to their default value, and remove all components
static void saveSettings()
          Save editable string settings of zones.
static void updateLookAndFeel()
          Update some optimization, painter,... etc depending on the current Look And Feel.
static void updateReversed()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

additionalZones

public final java.util.List<ExpandableZone> additionalZones
additional zones of this player


expandedZone

public static ExpandableZone expandedZone
This is the current expanded zone. Is null if no zone is expanded.


hand

public Hand hand
hand of this player


play

public Play play
play zone of this player


triggeredBuffer

public TriggeredBuffer triggeredBuffer
triggered buffer of this player (TBZ)


delayedBuffer

public DelayedBuffer delayedBuffer
delayed buffer of this player (DBZ)


stack

public static Stack stack
shared stack of players


side

public static Side side
shared side of players

Constructor Detail

ZoneManager

public ZoneManager(int idPlayer,
                   javax.swing.JScrollPane handSPanel,
                   javax.swing.JScrollPane triggeredSPanel,
                   javax.swing.JScrollPane delayedSPanel,
                   javax.swing.JPanel additionalZonesPanel)
Creates an ew instance of ZoneManager

Parameters:
idPlayer - id of associated player
handSPanel -
triggeredSPanel -
delayedSPanel -
additionalZonesPanel -
Method Detail

initTbs

public static void initTbs(java.io.InputStream inputStream)
                    throws java.io.IOException

Parameters:
inputStream - the stream containing the layout configuration of this zone for a specified layout
Throws:
java.io.IOException - error during the configuration read.

getContainer

public MZone getContainer(int idZone)
return the container corresponding to the specified idZone

Parameters:
idZone - idplace of matched container
Returns:
the container of a specified idZone

updateReversed

public static void updateReversed()

reset

public void reset()
Set the zone attribut to their default value, and remove all components


countAllCardsOf

public int countAllCardsOf(Test test,
                           Ability ability)
Checks all cards corresponding to the specified constraints

Parameters:
test - applied to count valid cards
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
Returns:
amount of card matching with the specified test

countAllCardsOf

public int countAllCardsOf(Test test,
                           Ability ability,
                           int limit,
                           boolean canBePreempted)
Checks all cards corresponding to the specified constraints.

Parameters:
test - applied to count valid cards
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
limit - is the desired count.
canBePreempted - true if the valid targets can be derterminated before runtime.
Returns:
amount of cards matching with the specified test. Highest value is limit.

updateLookAndFeel

public static void updateLookAndFeel()
Update some optimization, painter,... etc depending on the current Look And Feel.


checkAllCardsOf

public void checkAllCardsOf(Test test,
                            java.util.List<Targetable> list,
                            Ability ability)
Checks all cards corresponding to this constraints

Parameters:
test - applied to count valid cards
list - the list containing the founded cards
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.

giveCards

public void giveCards(Deck deck,
                      java.io.FileInputStream dbFile)
               throws java.io.IOException
Fill the player's init zone with cards found in the given InputFile

Parameters:
deck - the deck of this player.
dbFile - opened file read containing the available cards
Throws:
java.io.IOException - If some other I/O error occurs

init

public static void init(javax.swing.JScrollPane sideSPanel,
                        javax.swing.JScrollPane stackSPanel)
Parameters:
sideSPanel -
stackSPanel -

saveSettings

public static void saveSettings()
Save editable string settings of zones.


getZoneName

public static java.lang.String getZoneName(int idZone)
Return the zone name corresponding to the given zone id.

Parameters:
idZone - the zone id.
Returns:
the zone name corresponding to the given zone id.

getValidTargetZones

public java.util.List<MZone> getValidTargetZones()
Return All available zones.

Returns:
All available zones.


Copyright © 2003-2007 Magic-Project. All Rights Reserved.