public class ExtractableModel extends FeatureModel implements Extractable
Constructor and Description |
---|
ExtractableModel(Services services)
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(FeatureProvider provider)
Prepare the feature.
|
void |
setResourcesQuantity(int quantity)
Set the resources quantity.
|
void |
setResourcesType(Enum<?> type)
Set the resources type.
|
checkListener, getFeature, getFeatures, getFeaturesType, hasFeature
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkListener
getFeature, getFeatures, getFeaturesType, hasFeature
public ExtractableModel(Services services)
The Services
must provide the following services:
The Featurable
must have:
services
- The services reference.public void prepare(FeatureProvider provider)
Feature
Featurable.addFeature(Feature)
or
Featurable.addFeatureAndGet(Feature)
.prepare
in interface Feature
prepare
in class FeatureModel
provider
- The owner 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 © 2017 Byron 3D Games Studio. All rights reserved.