gizmoball.xmlparser
Class GizmoStringConstructorMap

java.lang.Object
  extended by gizmoball.xmlparser.GizmoStringConstructorMap

public class GizmoStringConstructorMap
extends java.lang.Object

This is a factory class which is used by XMLParser to create gizmos/balls from an XML file XMLParser passes in a Map which is parsed, and the appropriate private helper factory is used


Method Summary
static Ball ballCreator(java.util.Map<java.lang.String,java.lang.String> ballAttributes, java.util.Map<java.lang.String,java.lang.String> boardAttributes)
          This takes the XML string representation of the board and a ball and generates a ball appropriately.
static Gizmo gizmoCreator(java.lang.String type, java.util.Map<java.lang.String,java.lang.String> attributes, GameWorldState gws)
          This takes the XML string representation of the gizmo and chooses the appropriate factory method to generate it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

ballCreator

public static Ball ballCreator(java.util.Map<java.lang.String,java.lang.String> ballAttributes,
                               java.util.Map<java.lang.String,java.lang.String> boardAttributes)
This takes the XML string representation of the board and a ball and generates a ball appropriately. Namely, ballAttributes correspond to the attributes of a ball (such as position, velocity, etc.), whereas boardAttributes correspond to aspects of the game that are stored within the ball, such as friction, gravity, etc.

Requires:
ballAttributes, boardAttributes contain all of the specified required information to be properly parsed
Returns:
A Ball b based off of the given attributes

gizmoCreator

public static Gizmo gizmoCreator(java.lang.String type,
                                 java.util.Map<java.lang.String,java.lang.String> attributes,
                                 GameWorldState gws)
This takes the XML string representation of the gizmo and chooses the appropriate factory method to generate it

Requires:
attributes corresponds to a gizmo
Returns:
a GameObject