public void EconomicPullValue(Centers MapCenter) { var pullvalue = Biome.EconomicPullValue(); switch (MapCenter.mapData.Biome.BiomeType()) { case BiomeTypes.Bare: case BiomeTypes.Snow: case BiomeTypes.Ice: case BiomeTypes.Scorched: break; default: foreach (Corners crn in MapCenter.corners) { pullvalue += crn.mapdata.River ?? 0; } foreach (Centers ngbh in MapCenter.neigbors) { if (Econimicboon(ngbh.mapData.Biome.BiomeType())) { pullvalue++; } } break; } BaseEconPull = pullvalue; Villiage.SetBaseEconomics(pullvalue); }
internal void AddToTouches(Centers d1) { if (d1 != null && !touches.Any(x => x.Equals(d1))) { touches.Add(d1); } }
public void AddTownToList(int pathlenght, Centers towncenter, Dictionary <Centers, Centers> camefrom) { if (!TownAlreadyMeasured(towncenter) || (TownAlreadyMeasured(towncenter) && pathlenght < distancetoalltowns[towncenter].Distance)) { distancetoalltowns[towncenter] = (new TownDistance { Distance = pathlenght, town = towncenter, pathway = camefrom }); } }
public Edges(int index, Centers leftCenter, Centers rightCenter, Corners startCorner, Corners endCorner, VoronoiPoint mdpt) { Index = index; delaunayCenter1 = leftCenter; delaunayCenter2 = rightCenter; voronoiCorner1 = startCorner; voronoiCorner2 = endCorner; midpoint = mdpt; BordersAndProtrudes(); mapdata = new EdgeMapData(); }
internal void AddTownToListReversed(int pathlenght, Centers towncenter, Dictionary <Centers, Centers> camefrom) { if (!TownAlreadyMeasured(towncenter) || pathlenght < distancetoalltowns[towncenter].Distance) { reversecamefrom.Clear(); foreach (KeyValuePair <Centers, Centers> node in camefrom.Reverse()) { reversecamefrom[node.Value] = node.Key; } distancetoalltowns[towncenter] = (new TownDistance { Distance = pathlenght, town = towncenter, pathway = reversecamefrom }); } }
public Town(Centers loc) { location = loc; distancetoalltowns = new Dictionary <Centers, TownDistance>(); reversecamefrom = new Dictionary <Centers, Centers>(); }
public bool TownAlreadyMeasured(Centers center) { return(distancetoalltowns.ContainsKey(center)); }
public CenterMapData(Centers location) { Villiage = new Town(location); }
internal void ProtrudesandTouches(Edges dualGraphVertex, Centers d0, Centers d1) { protrudes.Add(dualGraphVertex); AddToTouches(d0); AddToTouches(d1); }