## edu.cwru.SimpleRTS.environment
Class State.StateBuilder

    java.lang.Object
      edu.cwru.SimpleRTS.environment.State.StateBuilder

Enclosing class:
  State

    public static class State.StateBuilder

extends java.lang.Object

Builder class that allows one-time access to a new state for construction purposes.

Author:
  Tim

Constructor Summary
`State.StateBuilder()`

Method Summary
`void` `addResource(ResourceNode r)`
`void` `addTemplate(Template t, int player)`
`void` `addUnit(Unit u)`
`State` `build()` Completes construction of the state and returns a reference to the state.
`boolean` `closed()`
`Template` `getTemplate(int player, java.lang.String name)`
`java.lang.String` `getTextString()`
`boolean` `hasTemplates(int player)`
`boolean` `positionAvailable(int x, int y)`
`void` `setResourceAmount(int player, ResourceType resource, int amount)`
`void` `setSize(int x, int y)`
`void` `setSupplyCap(int player, int supply)`
`void` `setTurn(int turn)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### State.StateBuilder

    public State.StateBuilder()

Method Detail

### addUnit

    public void addUnit(Unit u)

### addTemplate

    public void addTemplate(Template t,
                            int player)

### getTemplate

    public Template getTemplate(int player,
                                java.lang.String name)

### setSize

    public void setSize(int x,
                        int y)

### positionAvailable

    public boolean positionAvailable(int x,
                                     int y)

### addResource

    public void addResource(ResourceNode r)

### setTurn

    public void setTurn(int turn)

### setResourceAmount

    public void setResourceAmount(int player,
                                  ResourceType resource,
                                  int amount)

### setSupplyCap

    public void setSupplyCap(int player,
                             int supply)

### getTextString

    public java.lang.String getTextString()

### hasTemplates

    public boolean hasTemplates(int player)

### build

    public State build()

  Completes construction of the state and returns a reference to the state. Subsequent calls to this method will result in returning null.

  Returns:
    - the state being built if this is the first call for this object, null otherwise

### closed

    public boolean closed()