import java.awt.*; public class object implements oo{ public String method=""; public int objnumber=-1; public Image image=null; public Sound sound=null; public String methods[]=new String[25]; public String retval=""; public Global global; // Global variables public General general; // Push / Trow methods // Needed to feed the execute method public void setMethod(String s){ method=s; } // Return the retval set in functions ('method') public String getRetval(){ return retval; } // Returns the name public String toString(){ return "object"+objnumber; } // Return the object number (init in objects) public int getNr(){return objnumber;} public boolean is(String meth){ boolean retval=false; int m=methods.length; for(int i=0; i < m && !retval && methods[i]!=null; i++){ if(methods[i].compareTo(meth) == 0) retval=true; } return retval; } // Needs to be overrided public void execute(){ } // // Needs to be overrided when there are more images / sound that we want to load // Or if the objects have different forms (like water) // public void init(Global glbl){ global=glbl; if(image == null){ image=global.loadImage(global.Server, global.Directory+getNr()+global.Extention, global.show); } } public Image getImage(){return image;} }