Пример #1
0
        public int GetPlacementWeightOnCell(IResourceDefinition resource, IHexCell cell)
        {
            if (NodeLocationCanon.GetPossessionsOfOwner(cell).Any() || cell.Feature != CellFeature.None)
            {
                return(0);
            }

            int weight = resource.GetWeightFromTerrain(cell.Terrain) +
                         resource.GetWeightFromShape(cell.Shape) +
                         resource.GetWeightFromVegetation(cell.Vegetation);

            return(Math.Max(0, weight));
        }