ballworld.model.paint
Class AnimatePaintStrategy
java.lang.Object
ballworld.model.paint.APaintStrategy
ballworld.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 APaintStrategy[] |
paintStrats
The paint strategies to cycle through |
Method Summary |
void |
paintXfrm(java.awt.Graphics g,
Ball host,
java.awt.geom.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 APaintStrategy[] 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(APaintStrategy... 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(java.awt.geom.AffineTransform at,
APaintStrategy... 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(java.awt.Graphics g,
Ball host,
java.awt.geom.AffineTransform at)
- Paints the currently indexed paint strategy on the given Graphics context
using the supplied AffineTransform. Called by the inherited paint method.
- Specified by:
paintXfrm
in class APaintStrategy
- Parameters:
g
- The Graphics context to paint upon.host
- The host Ballat
- The AffineTransform to use