001 package test;
002
003 import java.util.HashMap;
004 import java.util.Map;
005
006 import junit.framework.TestCase;
007 import physics3d.Vect3;
008
009 import components.Ball;
010 import components.BallFactory;
011 import components.GameObject;
012 import components.GameObjectClassification;
013 import components.GameObjectFactory;
014 import components.GameSettings;
015 import components.GameSpace;
016
017 public class TestGO extends TestCase {
018
019
020 public TestGO(String name) {
021 super(name);
022
023 }
024
025 protected void setUp() {}
026
027 //test ball creation
028
029 public void testGOC() {
030 for (GameObjectClassification goc : GameObjectClassification.values()) {
031 //System.out.println(goc.toString());
032 }
033
034 GameSettings settings = new GameSettings();
035 GameSpace g = new GameSpace(settings);
036 Ball b = new Ball(Vect3.Z_HAT,"bob",g);
037 Map<String,String> newmap = new HashMap<String,String>();
038 b.getBasicPropertyMap(newmap);
039 //System.out.println(newmap.toString());
040
041 /*
042 GameObjectFactory<Ball> f = new BallFactory();
043 GameObject ballquestionmark = f.newInstance(newmap, g);
044
045 Map<String,String> newmap2 = new HashMap<String,String>();
046 ballquestionmark.getBasicPropertyMap(newmap2);
047 */
048
049 g.loadObject(GameObjectClassification.BALL, newmap);
050 g.loadObject(GameObjectClassification.SQUAREBUMPER, newmap);
051 g.loadObject(GameObjectClassification.LEFTFLIPPER, newmap);
052 g.loadObject(GameObjectClassification.TRIANGLEBUMPER, newmap);
053
054 for (GameObject go : g.getObjects()) {
055 Map<String,String> tmpmap = new HashMap<String,String>();
056 go.getBasicPropertyMap(tmpmap);
057 //System.out.println(go.getGOClassification().toString() + ": " +tmpmap.toString());
058 }
059
060
061 // //System.out.println(newmap2.toString());
062 }
063 }