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

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

All Implemented Interfaces:
  java.io.Serializable

Enclosing class:
  State

    public static class State.StateView

extends java.lang.Object
implements java.io.Serializable

Provides a read-only view of class values

Author:
  Tim
See Also:
  Serialized Form

Method Summary
`boolean` `doesPlayerHaveUnit(int player, int buildingtemplateid)`
`java.util.List<java.lang.Integer>` `getAllResourceIds()`
`java.util.List<java.lang.Integer>` `getAllTemplateIds()`
`java.util.List<java.lang.Integer>` `getAllUnitIds()`
`int[]` `getClosestOpenPosition(int x, int y)`
`EventLogger.EventLoggerView` `getEventLog()`
`int` `getResourceAmount(int player, ResourceType type)`
`ResourceNode.ResourceView` `getResourceNode(int resourceID)`
`java.util.List<java.lang.Integer>` `getResourceNodeIds(ResourceNode.Type type)`
`int` `getSupplyAmount(int player)`
`int` `getSupplyCap(int player)`
`Template.TemplateView` `getTemplate(int templateID)`
`Template.TemplateView` `getTemplate(int player, java.lang.String name)` Get a template with that name owned by that player
`java.util.List<java.lang.Integer>` `getTemplateIds(int agent)`
`int` `getTurnNumber()`
`Unit.UnitView` `getUnit(int unitID)`
`java.util.List<java.lang.Integer>` `getUnitIds(int player)`
`int` `getXExtent()`
`int` `getYExtent()`
`boolean` `hasUpgrade(int upgradeid, int playerid)`
`boolean` `inBounds(int x, int y)`
`boolean` `isResourceAt(int x, int y)`
`boolean` `isUnitAt(int x, int y)` Get the unit at a position
`java.lang.Integer` `resourceAt(int x, int y)` Get the resource at a position
`java.lang.Integer` `unitAt(int x, int y)`

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

Method Detail

### getEventLog

    public EventLogger.EventLoggerView getEventLog()

### getAllUnitIds

    public java.util.List<java.lang.Integer> getAllUnitIds()

### getTurnNumber

    public int getTurnNumber()

### getUnitIds

    public java.util.List<java.lang.Integer> getUnitIds(int player)

### getUnit

    public Unit.UnitView getUnit(int unitID)

### getAllResourceIds

    public java.util.List<java.lang.Integer> getAllResourceIds()

### getResourceNodeIds

    public java.util.List<java.lang.Integer> getResourceNodeIds(ResourceNode.Type type)

### getResourceNode

    public ResourceNode.ResourceView getResourceNode(int resourceID)

### getAllTemplateIds

    public java.util.List<java.lang.Integer> getAllTemplateIds()

### getTemplateIds

    public java.util.List<java.lang.Integer> getTemplateIds(int agent)

### getTemplate

    public Template.TemplateView getTemplate(int templateID)

### getTemplate

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

  Get a template with that name owned by that player

  Parameters:
    `player` -
    `name` -
  Returns:
    The view of the first (and what should be the only) template that has the specified name, or null if that player does not have a template by that name

### getResourceAmount

    public int getResourceAmount(int player,
                                 ResourceType type)

### getSupplyAmount

    public int getSupplyAmount(int player)

### getSupplyCap

    public int getSupplyCap(int player)

### getClosestOpenPosition

    public int[] getClosestOpenPosition(int x,
                                        int y)

### getXExtent

    public int getXExtent()

### getYExtent

    public int getYExtent()

### doesPlayerHaveUnit

    public boolean doesPlayerHaveUnit(int player,
                                      int buildingtemplateid)

### hasUpgrade

    public boolean hasUpgrade(int upgradeid,
                              int playerid)

### inBounds

    public boolean inBounds(int x,
                            int y)

### isUnitAt

    public boolean isUnitAt(int x,
                            int y)

  Get the unit at a position

  Parameters:
    `x` -
    `y` -
  Returns:
    The unit's ID, or null if there is no unit

### unitAt

    public java.lang.Integer unitAt(int x,
                                    int y)

### isResourceAt

    public boolean isResourceAt(int x,
                                int y)

### resourceAt

    public java.lang.Integer resourceAt(int x,
                                        int y)

  Get the resource at a position

  Parameters:
    `x` -
    `y` -
  Returns:
    The resource's ID, or null if there is no resource