-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Magnus
authored and
Magnus
committed
Nov 25, 2014
1 parent
900b389
commit 8544fe6
Showing
6 changed files
with
34 additions
and
58 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
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
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
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 |
---|---|---|
@@ -1,46 +1,29 @@ | ||
package hotciv.variants; | ||
|
||
import hotciv.common.CityImpl; | ||
import hotciv.common.TileImpl; | ||
import hotciv.framework.common.GameConstants; | ||
import hotciv.framework.common.Player; | ||
import hotciv.framework.common.Position; | ||
import hotciv.framework.common.Tile; | ||
import hotciv.framework.common.Worlds; | ||
import hotciv.framework.strategy.WorldLayoutStrategy; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class AlphaCivWorldLayout implements WorldLayoutStrategy { | ||
|
||
private Map<Position,Tile> world; | ||
|
||
public AlphaCivWorldLayout(String[] layout){ | ||
world = defineWorld(layout); | ||
world = Worlds.defineWorld(layout); | ||
} | ||
|
||
public void putCities(HashMap<Position, CityImpl> cities) { | ||
cities.put(new Position(1,1), new CityImpl(Player.RED)); | ||
cities.put(new Position(4,1), new CityImpl(Player.BLUE)); | ||
} | ||
|
||
public Tile getTileAt(Position p) { | ||
Tile t = null; | ||
if(p.getRow()==0 && p.getColumn()==1){ | ||
t= new TileImpl(GameConstants.OCEANS); | ||
}else if(p.getRow()==1 && p.getColumn()==0){ | ||
t = new TileImpl(GameConstants.HILLS); | ||
}else if(p.getRow()==2 && p.getColumn()==2 ){ | ||
t = new TileImpl(GameConstants.MOUNTAINS); | ||
}else{ | ||
t = new TileImpl(GameConstants.PLAINS); | ||
} | ||
return t; | ||
} | ||
|
||
@Override | ||
public Map<Position, Tile> defineWorld(String[] layout) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
return world.get(p); | ||
} | ||
} |
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
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