ballwar.model.paint
Class AnimatePaintStrategy
java.lang.Object
ballwar.model.paint.APaintStrategy
ballwar.model.paint.AnimatePaintStrategy
- All Implemented Interfaces:
- IPaintStrategy
- Direct Known Subclasses:
- SwimFishPaintStrategy
public class AnimatePaintStrategy
- extends APaintStrategy
Concrete paint strategy that cycles through a sequence of paint
strategies, painting one per paint update.
Note: This paint strategy cannot be directly instantiated by the
BallWar system because it does not have a no-parameter constructor.
Field Summary |
private int |
count
The counter that keeps track of which paint strategy to use next. |
private IPaintStrategy[] |
paintStrats
The paint strategies to cycle through |
Method Summary |
void |
paintXfrm(Graphics g,
Ball host,
AffineTransform at)
Paints the currently indexed paint strategy on the
given Graphics context using the
supplied AffineTransform. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
paintStrats
private IPaintStrategy[] paintStrats
- The paint strategies to cycle through
count
private int count
- The counter that keeps track of which paint strategy to use next.
AnimatePaintStrategy
public AnimatePaintStrategy(IPaintStrategy... pstrats)
- Constructor that instantiates an AffineTransform for internal use.
- Parameters:
pstrats
- vararg input of the paint strategies to cycle through, in order.
AnimatePaintStrategy
public AnimatePaintStrategy(AffineTransform at,
IPaintStrategy... pstrats)
- Constructor that uses the supplied AffineTransform for internal use.
- Parameters:
at
- The AffineTransform to use.pstrats
- vararg input of the paint strategies to cycle through, in order.
paintXfrm
public void paintXfrm(Graphics g,
Ball host,
AffineTransform at)
- Paints the currently indexed paint strategy on the
given Graphics context using the
supplied AffineTransform. Called by the inherited paint method.
- Parameters:
g
- The Graphics context to paint upon.host
- The host Ballat
- The AffineTransform to use