public class ExtractableModel extends TraitModel implements Extractable
The ObjectGame
owner must have the following Trait
:
The Services
must provide the following services:
Constructor and Description |
---|
ExtractableModel()
Create an extractable model.
|
Modifier and Type | Method and Description |
---|---|
int |
extractResource(int quantity)
Extract the specified quantity if possible.
|
int |
getInTileHeight()
Get the height in tile.
|
int |
getInTileWidth()
Get the width in tile.
|
int |
getInTileX()
Get horizontal tile location.
|
int |
getInTileY()
Get vertical tile location.
|
int |
getResourceQuantity()
Get the current resource quantity.
|
Enum<?> |
getResourceType()
Get the resource type that can be extracted.
|
void |
prepare(ObjectGame owner,
Services services)
Prepare the trait.
|
void |
setResourcesQuantity(int quantity)
Set the resources quantity.
|
void |
setResourcesType(Enum<?> type)
Set the resources type.
|
getOwner
public void prepare(ObjectGame owner, Services services)
Trait
prepare
in interface Trait
prepare
in class TraitModel
owner
- The owner reference.services
- The services reference.public int extractResource(int quantity)
Extractable
extractResource
in interface Extractable
quantity
- The quantity to extract.public void setResourcesQuantity(int quantity)
Extractable
setResourcesQuantity
in interface Extractable
quantity
- The resources quantity.public void setResourcesType(Enum<?> type)
Extractable
setResourcesType
in interface Extractable
type
- The resources type.public int getResourceQuantity()
Extractable
getResourceQuantity
in interface Extractable
public Enum<?> getResourceType()
Extractable
getResourceType
in interface Extractable
public int getInTileX()
Tiled
getInTileX
in interface Tiled
public int getInTileY()
Tiled
getInTileY
in interface Tiled
public int getInTileWidth()
Tiled
getInTileWidth
in interface Tiled
public int getInTileHeight()
Tiled
getInTileHeight
in interface Tiled
Copyright © 2016 Byron 3D Games Studio. All rights reserved.