Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.cwru.SimpleRTS.model
Class Template<T>

    java.lang.Object
      edu.cwru.SimpleRTS.model.Template<T>

Type Parameters:
  `T` -

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  UnitTemplate, UpgradeTemplate

    public abstract class Template<T>

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

Signifies that an implementing class provides generic details about a specific object. Also provides a means for creating factory methods for specific kinds of game objects.

Author:
  Tim
See Also:
  Serialized Form

Nested Class Summary
`static class` | `Template.TemplateView`

Field Summary
`int` | `ID`

Constructor Summary
`Template()`

Method Summary
`void` | `addBuildPrereqItem(java.lang.String name)`
`void` | `addUpgradePrereqItem(java.lang.String name)`
`boolean` | `canProduce(State.StateView state)`
`boolean` | `equals(java.lang.Object o)`
`int` | `getFoodCost()`
`int` | `getGoldCost()`
`java.lang.String` | `getName()`
`int` | `getPlayer()`
`int` | `getTimeCost()`
`Template.TemplateView` | `getView()`
`int` | `getWoodCost()`
`int` | `hashCode()`
`void` | `namesToIds(java.util.List<UnitTemplate> untemplates, java.util.List<UpgradeTemplate> uptemplates)` Turn this template's list of prerequisites and things it produces into their ids
`abstract T` | `produceInstance()` A factory method that produces copies of a "default" object
`static void` | `reserveIDsUpTo(int minID)`
`void` | `setFoodCost(int foodCost)`
`void` | `setGoldCost(int goldCost)`
`void` | `setName(java.lang.String name)`
`void` | `setPlayer(int playerid)`
`void` | `setTimeCost(int timeCost)`
`void` | `setWoodCost(int woodCost)`

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

Field Detail

### ID

    public final int ID

Constructor Detail

### Template

    public Template()

Method Detail

### produceInstance

    public abstract T produceInstance()

  A factory method that produces copies of a "default" object

  Returns:

### reserveIDsUpTo

    public static void reserveIDsUpTo(int minID)

### canProduce

    public boolean canProduce(State.StateView state)

### getTimeCost

    public int getTimeCost()

### setTimeCost

    public void setTimeCost(int timeCost)

### setName

    public void setName(java.lang.String name)

### getName

    public java.lang.String getName()

### getGoldCost

    public int getGoldCost()

### setGoldCost

    public void setGoldCost(int goldCost)

### getWoodCost

    public int getWoodCost()

### setWoodCost

    public void setWoodCost(int woodCost)

### getFoodCost

    public int getFoodCost()

### setFoodCost

    public void setFoodCost(int foodCost)

### setPlayer

    public void setPlayer(int playerid)

### getPlayer

    public int getPlayer()

### addBuildPrereqItem

    public void addBuildPrereqItem(java.lang.String name)

### addUpgradePrereqItem

    public void addUpgradePrereqItem(java.lang.String name)

### namesToIds

    public void namesToIds(java.util.List<UnitTemplate> untemplates,
                           java.util.List<UpgradeTemplate> uptemplates)

  Turn this template's list of prerequisites and things it produces into their ids

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### equals

    public boolean equals(java.lang.Object o)

  Overrides:
    `equals` in class `java.lang.Object`

### getView

    public Template.TemplateView getView()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD