Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move around some terrain class (and its test) so we can add a dummy
harvestable terrain
- Loading branch information
1 parent
7734671
commit c633703
Showing
3 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...c/d2tm/game/terrain/EmptyTerrainTest.java → ...m/game/terrain/impl/EmptyTerrainTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/test/java/com/fundynamic/d2tm/game/terrain/impl/HarvestableTerrain.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.fundynamic.d2tm.game.terrain.impl; | ||
|
||
import com.fundynamic.d2tm.game.terrain.Harvestable; | ||
import org.newdawn.slick.Image; | ||
|
||
/** | ||
* A stub for harvestable terrain used for testing purposes | ||
*/ | ||
public class HarvestableTerrain extends EmptyTerrain implements Harvestable { | ||
|
||
private int amount; | ||
|
||
public HarvestableTerrain(Image image, int amount) { | ||
super(image); | ||
this.amount = amount; | ||
} | ||
|
||
@Override | ||
public int harvest(int amount) { | ||
return this.amount -= amount; | ||
} | ||
} |