package objects;

import java.util.ResourceBundle;

import jboxGlue.PhysicalObject;
import jgame.JGColor;

public abstract class GameObject extends PhysicalObject{
    public static final String DEFAULT_RESOURCE_PACKAGE = "engineResources/";
    public static final String DEFAULT_BEHAVIOR = "";
    
	protected ResourceBundle myDieWays;
	protected ResourceBundle myMoveWays;

	protected GameObject(String name, int collisionId, JGColor color) {
		super(name, collisionId, color);
	}
	
	protected void initObject(){
		myDieWays = ResourceBundle.getBundle(DEFAULT_RESOURCE_PACKAGE + DEFAULT_BEHAVIOR);
	}
	
	protected GameObject(String name, int collisionId, String gfxname){
		super(name, collisionId, gfxname);
	}
	
	public setDieBehavior(String s){
		
	}
	
	public void die(){
		
	}
}

@@ -45,16 +45,95 @@
 undle;%0A%0A
+import util.reflection.Reflection;%0Aimport util.reflection.ReflectionException;%0A
 import j
@@ -447,16 +447,47 @@
 oveWays;
+%0A%09protected String myDieString;
 %0A%0A%09prote
@@ -828,16 +828,21 @@
 %09public 
+void 
 setDieBe
@@ -857,24 +857,40 @@
 tring s)%7B%0A%09%09
+myDieString = s;
 %0A%09%7D%0A%09%0A%09publi
@@ -905,14 +905,212 @@
 ie()%7B%0A%09%09
+try%7B%0A%09%09%09Object dieBehavior = Reflection.createInstance(myDieWays.getString(myDieString), this);%0A%09%09%09Reflection.callMethod(dieBehavior, %22remove%22);%09%0A%09%09%7D catch (Exception e)%7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D
 %0A%09%7D%0A%7D%0A

use Duvall's Reflection for Die Behavior