Genercize

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@522 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Charlie Groves
2008-06-04 18:18:56 +00:00
parent 795bfe0429
commit 6a0da5531e
@@ -138,12 +138,11 @@ public class CharacterManager
* should be instantiated instead of the configured default (which is * should be instantiated instead of the configured default (which is
* set via {@link #setCharacterClass}). * set via {@link #setCharacterClass}).
*/ */
public CharacterSprite getCharacter (CharacterDescriptor desc, public <T extends CharacterSprite> T getCharacter (CharacterDescriptor desc,
Class charClass) Class<T> charClass)
{ {
try { try {
CharacterSprite sprite = (CharacterSprite) T sprite = charClass.newInstance();
charClass.newInstance();
sprite.init(desc, this); sprite.init(desc, this);
return sprite; return sprite;
@@ -436,7 +435,7 @@ public class CharacterManager
protected LRUHashMap _frameCache; protected LRUHashMap _frameCache;
/** The character class to be created. */ /** The character class to be created. */
protected Class _charClass = CharacterSprite.class; protected Class<CharacterSprite> _charClass = CharacterSprite.class;
/** The action animation cache, if we have one. */ /** The action animation cache, if we have one. */
protected ActionCache _acache; protected ActionCache _acache;