private static string GetMaximumPopulationText(int terrainId, CellGrid cellGrid, HexOffsetCoordinates hexPoint) { var gameConfigCache = CallContext <GameConfigCache> .GetData("GameConfigCache"); var terrain = gameConfigCache.GetTerrainConfigById(terrainId); if (!terrain.CanSettleOn) { return(string.Empty); } var catchment = cellGrid.GetCatchment(hexPoint.Col, hexPoint.Row, 2); var maxPop = BaseFoodLevel.DetermineBaseFoodLevel(catchment); var text = $"Maximum Pop - {maxPop}"; return(text); }
public Cell GetCell(HexOffsetCoordinates location) { return(GetCell(location.Col, location.Row)); }
private static void DrawTileInfo(SpriteBatch spriteBatch, SpriteFont font, float x, float y, CellGrid cellGrid, HexOffsetCoordinates hexPoint) { var cell = cellGrid.GetCell(hexPoint); if (cell.SeenState == SeenState.NeverSeen) { return; } var terrain = GetTerrain(cell.TerrainId); var terrainTypeText = $"{terrain.Name} - {terrain.FoodOutput} food"; var maximumPopulationText = GetMaximumPopulationText(cell.TerrainId, cellGrid, hexPoint); spriteBatch.DrawString(font, terrainTypeText, new Vector2(x, y), Color.White); spriteBatch.DrawString(font, maximumPopulationText, new Vector2(x, y + 15.0f), Color.White); }