Modified sprite event mechanism to used classes derived from SpriteEvent

rather than codes to indicate different types of events. Also modified
name of sprite observer callback as spriteChanged() implies that the
sprite actually changed which it may not have, whereas handleEvent()
doesn't imply anything other than the sprite observer is being asked to
deal with a sprite event.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@338 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-09-13 19:36:20 +00:00
parent 780e39d4e9
commit 00fde3eeb3
6 changed files with 88 additions and 71 deletions
@@ -0,0 +1,32 @@
//
// $Id: CollisionEvent.java,v 1.1 2001/09/13 19:36:20 mdb Exp $
package com.threerings.media.sprite;
/**
* A collision event is dispatched when a sprite collides with another
* sprite.
*/
public class CollisionEvent extends SpriteEvent
{
/**
* Constructs a collision event for the specified sprites.
*/
public CollisionEvent (Sprite sprite, Sprite other)
{
super(sprite);
_other = other;
}
/**
* Returns the other sprite that was involved in this collision (the
* first sprite being available via {@link #getSprite}.
*/
public Sprite getOther ()
{
return _other;
}
/** A reference to the other sprite. */
protected Sprite _other;
}