public static Cell ToCell(this MapObjectData mapObjectData, Dictionary <UnitType, int> myArmy = null) { var x = mapObjectData.Location.X; var y = mapObjectData.Location.Y; int resourcesValue = 0; if (mapObjectData.Dwelling != null) { resourcesValue = mapObjectData.Dwelling.AvailableToBuyCount; } if (mapObjectData.ResourcePile != null) { resourcesValue = mapObjectData.ResourcePile.Amount; } return(new Cell(x, y, mapObjectData.GetTerrainCellType(myArmy), mapObjectData.GetObjectCellType(), resourcesValue)); }
public static string ToDataForPrint(this MapObjectData mapObject, Dictionary <UnitType, int> armyA = null) { return(mapObject.GetTerrainCellType(armyA).ToDataForPrint()); }