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.unit
Class Unit

    java.lang.Object
      edu.cwru.SimpleRTS.model.Target
          edu.cwru.SimpleRTS.model.unit.Unit

All Implemented Interfaces:
  java.io.Serializable

    public class Unit

extends Target

See Also:
  Serialized Form

Nested Class Summary
`static class` | `Unit.UnitView`

Field Summary

Fields inherited from class edu.cwru.SimpleRTS.model.Target
`ID, serialVersionUID`

Constructor Summary
`Unit(UnitTemplate template)`

Method Summary
`boolean` | `canAttack()`
`boolean` | `canBuild()`
`boolean` | `canGather()`
`boolean` | `canMove()`
`void` | `clearCargo()`
`boolean` | `equals(java.lang.Object o)`
`int` | `getAmountProduced()`
`char` | `getCharacter()`
`int` | `getCurrentCargoAmount()`
`ResourceType` | `getCurrentCargoType()`
`int` | `getCurrentHealth()`
`int` | `getCurrentProductionID()`
`int` | `getPlayer()`
`UnitTask` | `getTask()`
`UnitTemplate` | `getTemplate()`
`Unit.UnitView` | `getView()`
`int` | `getxPosition()`
`int` | `getyPosition()`
`int` | `hashCode()`
`void` | `incrementProduction(Template toproduce, State.StateView state)` Increment production amount
`boolean` | `pickUpResource(ResourceType type, int amount)`
`void` | `resetProduction()`
`void` | `setTask(UnitTask task)`
`void` | `setxPosition(int x)`
`void` | `setyPosition(int y)`
`void` | `takeDamage(int amount)`
`java.lang.String` | `toString()`

Methods inherited from class edu.cwru.SimpleRTS.model.Target
`reserveIDsUpTo`

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

Constructor Detail

### Unit

    public Unit(UnitTemplate template)

Method Detail

### getPlayer

    public int getPlayer()

### getCharacter

    public char getCharacter()

### getCurrentHealth

    public int getCurrentHealth()

### getxPosition

    public int getxPosition()

### setxPosition

    public void setxPosition(int x)

### getyPosition

    public int getyPosition()

### setyPosition

    public void setyPosition(int y)

### getTemplate

    public UnitTemplate getTemplate()

### takeDamage

    public void takeDamage(int amount)

  Parameters:
    `amount` -

### getAmountProduced

    public int getAmountProduced()

### getCurrentProductionID

    public int getCurrentProductionID()

### resetProduction

    public void resetProduction()

### incrementProduction

    public void incrementProduction(Template toproduce,
                                    State.StateView state)

  Increment production amount

  Parameters:
    `templateID` -

### canGather

    public boolean canGather()

### canBuild

    public boolean canBuild()

### canMove

    public boolean canMove()

### canAttack

    public boolean canAttack()

### 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`

### toString

    public java.lang.String toString()

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

### pickUpResource

    public boolean pickUpResource(ResourceType type,
                                  int amount)

### clearCargo

    public void clearCargo()

### getCurrentCargoType

    public ResourceType getCurrentCargoType()

### getCurrentCargoAmount

    public int getCurrentCargoAmount()

### setTask

    public void setTask(UnitTask task)

### getTask

    public UnitTask getTask()

### getView

    public Unit.UnitView 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