us.asciiroth.client.board
Class EffectBag

java.lang.Object
  extended by us.asciiroth.client.core.Bag<Effect>
      extended by us.asciiroth.client.board.EffectBag

public class EffectBag
extends Bag<Effect>

A bag representing the items in a cell. Following the simple C --> M --> V design of the application, this decorates a bag and adds updates to the map/view.


Nested Class Summary
 
Nested classes/interfaces inherited from class us.asciiroth.client.core.Bag
Bag.Entry<T extends Piece>
 
Constructor Summary
EffectBag(Cell cell)
          Constructor
 
Method Summary
 void add(Effect effect)
          Add one count of an item to the bag.
 void add(int index, Effect effect)
          Add an item to the bag at the indicated index.
 void addInFlightItem(Effect effect)
          Add an in-flight item effect.
 void moveEffectTo(Cell next, Effect effect)
          An optimization to avoid creating animation proxies for effects.
 void remove(Effect effect)
          Remove one count of an item from the bag.
 
Methods inherited from class us.asciiroth.client.core.Bag
asEntryList, contains, findEntry, get, getCount, getIndex, isEmpty, last, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EffectBag

public EffectBag(Cell cell)
Constructor

Parameters:
cell -
Method Detail

add

public void add(Effect effect)
Description copied from class: Bag
Add one count of an item to the bag.

Overrides:
add in class Bag<Effect>

add

public void add(int index,
                Effect effect)
Description copied from class: Bag
Add an item to the bag at the indicated index. Used in an attempt to manipulate what you can see in the effects layer.

Overrides:
add in class Bag<Effect>

addInFlightItem

public void addInFlightItem(Effect effect)
Add an in-flight item effect. It works out that it's much simpler to start on the shooter's square and fly from there, but visually this looks wrong, as the thrown/shot item momentarily appears on top of the agent doing the shooting. This eliminates the event that causes this, and all is just right. Also adds the flier to the bottom of the stack. I don't know why... this has never apparently fixed the "sometimes I don't see the hit effect when an agent dies" issue.

Parameters:
effect -

moveEffectTo

public void moveEffectTo(Cell next,
                         Effect effect)
An optimization to avoid creating animation proxies for effects.

Parameters:
next -
effect -

remove

public void remove(Effect effect)
Description copied from class: Bag
Remove one count of an item from the bag.

Overrides:
remove in class Bag<Effect>

0.7

© 2009 Alx Dark