From 987dd60efc8c75a40cd18be9ed8f5b1471e417e2 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 15 Mar 2002 01:10:25 +0000 Subject: [PATCH] Modified the way the following-path and resting actions are fetched so that we can specialize the character sprite to choose a resting action at random. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1122 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/cast/CharacterSprite.java | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/cast/CharacterSprite.java b/src/java/com/threerings/cast/CharacterSprite.java index e6dc06d32..8a6b4dda0 100644 --- a/src/java/com/threerings/cast/CharacterSprite.java +++ b/src/java/com/threerings/cast/CharacterSprite.java @@ -1,5 +1,5 @@ // -// $Id: CharacterSprite.java,v 1.23 2002/03/08 22:35:55 mdb Exp $ +// $Id: CharacterSprite.java,v 1.24 2002/03/15 01:10:25 mdb Exp $ package com.threerings.cast; @@ -50,6 +50,16 @@ public class CharacterSprite _restingAction = action; } + /** + * Returns the action to be used when the sprite is at rest. Derived + * classes may wish to override this method and vary the action based + * on external parameters (or randomly). + */ + public String getRestingAction () + { + return _restingAction; + } + /** * Specifies the action to use when the sprite is following a path. * The default is WALKING. @@ -59,6 +69,16 @@ public class CharacterSprite _followingPathAction = action; } + /** + * Returns the action to be used when the sprite is following a path. + * Derived classes may wish to override this method and vary the + * action based on external parameters (or randomly). + */ + public String getFollowingPathAction () + { + return _followingPathAction; + } + /** * Sets the action sequence used when rendering the character, from * the set of available sequences. @@ -142,7 +162,7 @@ public class CharacterSprite super.pathBeginning(); // enable walking animation - setActionSequence(_followingPathAction); + setActionSequence(getFollowingPathAction()); setAnimationMode(TIME_BASED); } @@ -162,7 +182,7 @@ public class CharacterSprite // disable animation setAnimationMode(NO_ANIMATION); // come to a halt looking settled and at peace - setActionSequence(_restingAction); + setActionSequence(getRestingAction()); } /** The action to use when at rest. */