HomelandsTerrain GetTerrain(GaeaWorldbuilder map, Dictionary <string, float> locationQualities) { eTerrain type = GetTerrainTypeFromQualities(map, locationQualities); HomelandsTerrain terrain = new HomelandsTerrain(type); return(terrain); }
HomelandsTerrain GetTerrain(Dictionary <string, float> locationQualities) { eTerrain type = GetTerrainTypeFromQualities(locationQualities); HomelandsTerrain terrain = new HomelandsTerrain(type); return(terrain); }
public HomelandsLocation(HomelandsGame game, Pos pos, HomelandsTerrain terrain, HomelandsResource resource) { _pos = pos; _game = game; _viewer = game._viewer; _terrain = terrain; _resource = resource; }
Dictionary <Pos, HomelandsLocation> BuildLocations(MapSettings mapSettings, IMapLocSetter mapLocSetter) { Dictionary <Pos, HomelandsLocation> locations = new Dictionary <Pos, HomelandsLocation>(); for (int x = 0; x < mapSettings._xDim; x++) { for (int y = 0; y < mapSettings._yDim; y++) { Loc l = new Loc(x, y); Pos p = new Pos(l, mapLocSetter); HomelandsTerrain terrain = new HomelandsTerrain(eTerrain.Land); HomelandsResource resource = GetResource(x, y); locations[p] = LocationFactory.Make(_game, p, terrain, resource); } } return(locations); }
Dictionary <Pos, HomelandsLocation> BuildLocations(GaeaWorldbuilder map, IMapLocSetter mapLocSetter) { Dictionary <Pos, HomelandsLocation> locations = new Dictionary <Pos, HomelandsLocation>(); for (int x = 0; x < map.xDim; x++) { for (int y = 0; y < map.yDim; y++) { Loc l = new Loc(x, y); Pos p = new Pos(l, mapLocSetter); Dictionary <string, float> locationQualities = map.GetLocationQualities(x, y); HomelandsTerrain terrain = GetTerrain(map, locationQualities); HomelandsResource resource = terrain._type == eTerrain.Land && Random.Range(0f, 1f) > 0.90f ? new HomelandsResource() : null; locations[p] = LocationFactory.Make(_game, p, terrain, resource); } } return(locations); }
public static HomelandsLocation Make(HomelandsGame game, Pos position, HomelandsTerrain terrain, HomelandsResource resource) { eGame gameType = game._settings._gameType; if (gameType == eGame.Exodus) { return(new ExodusLocation(game, position, terrain, resource)); } else if (gameType == eGame.Sandbox) { return(new SandboxLocation(game, position, terrain, resource)); } else { return(new SandboxLocation(game, position, terrain, resource)); //throw new KeyNotFoundException(); } }
public ExodusLocation(HomelandsGame game, Pos pos, HomelandsTerrain terrain, HomelandsResource resource) : base(game, pos, terrain, resource) { }