Skip to content

Commit

Permalink
add resource enum
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-Aghayari committed Apr 18, 2022
1 parent 091c0fd commit 21cac3b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 21 deletions.
11 changes: 10 additions & 1 deletion src/models/Resource/TileResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.ArrayList;

import models.Feature.TileFeatureEnum;
import models.Technology.TechEnum;
import models.Improvement.TileImprovementEnum;
import models.Tile.TileModeEnum;
Expand All @@ -15,6 +16,14 @@ public class TileResource {
private TechEnum requisiteTech;
private ArrayList<TileModeEnum> whereCanBeFind;


public TileResource(TileResourceEnum resourceName) {
setResourceName(resourceName);
setFood(resourceName.getFood());
setProduction(resourceName.getProduction());
setGold(resourceName.getGold());
}

public TileResourceEnum getResourceName() {
return this.resourceName;
}
Expand Down Expand Up @@ -70,6 +79,6 @@ public ArrayList<TileModeEnum> getWhereCanBeFind() {
public void setWhereCanBeFind(ArrayList<TileModeEnum> whereCanBeFind) {
this.whereCanBeFind = whereCanBeFind;
}


}
65 changes: 45 additions & 20 deletions src/models/Resource/TileResourceEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,50 @@

public enum TileResourceEnum {

banana("banana"),
cow("cow"),
gazelle("gazelle"),
sheep("sheep"),
wheat("wheat"),
coal("coal"),
horse("horse"),
iron("iron"),
cotton("cotton"),
fur("fur"),
gemStones("gemStones"),
gold("gold"),
//بخور؟
tusk("tusk"),
marble("marble"),
silk("silk"),
silver("silver"),
sugar("sugar");

TileResourceEnum(String name) {
banana("banana", 1, 0, 0),
cow("cow", 1, 0, 0),
gazelle("gazelle", 1, 0, 0),
sheep("sheep", 1, 0, 0),
wheat("wheat", 1, 0, 0),
coal("coal", 0, 1, 0),
horse("horse", 0, 1, 0),
iron("iron", 0, 1, 0),
cotton("cotton", 0, 0, 2),
fur("fur", 0, 0, 2),
gemStones("gemStones", 0, 0, 2),
GOLD("gold", 0, 0, 3),
INCENSE("incense", 0, 0, 2),
tusk("tusk", 0, 0, 2),
marble("marble", 0, 0, 2),
silk("silk", 0, 0, 2),
silver("silver", 0, 0, 2),
sugar("sugar", 0, 0, 2);

private final String name;
private final int food;
private final int production;
private final int gold;

TileResourceEnum(String name, int food, int production, int gold) {
this.name = name;
this.food = food;
this.production = production;
this.gold = gold;
}

public String getName() {
return name;
}

public int getFood() {
return food;
}

public int getProduction() {
return production;
}

public int getGold() {
return gold;
}
}

0 comments on commit 21cac3b

Please sign in to comment.